6

How can I set Word 2010 so that save as PDF is a 1 button (or key-stroke) option instead of the default 4-step File > Save & Send > Create PDF/XPS Document > Create PDF/XPS workflow?

5

I have added "PDF or XPS" command to my Ribbon here at home computer (with Word 2007) and I did exactly the same at my office computer (with Word 2010; though I don't remember, if command was named the same there).

Now, I have an extra button on my Ribbon, showing "PDF or XPS" in tooltip, when I hover mouse over it and when I click it, it opens a Save as dialog, where I can specify file name for a PDF file, that will be created in next step, basing on my currently open DOCX (or other) document.

You can add this from the More Commands. The "Publish as PDF or XPS" command is part of the File Tab.

3
  • on my computer, "Customize the Quick Access Toolbar > Choose from: All Commands" jumps from "Pause recording" to "Pen" with nary a PDF/XPS in sight. – matt wilkie Sep 17 '12 at 21:23
  • oh there it is, silly me. It's called "Publish to PDF". – matt wilkie Sep 17 '12 at 21:28
  • Glad, I could help! No, you're not silly, I recall that I also had some strange problems locating this command, before adding it into Ribbon. All thanks to M$ and their idiotic scheme of naming some things (they just love to complicate fairly easy things!)... – trejder Sep 17 '12 at 21:34
6

There are two things you need to do.

  1. Create a macro to do what you want
  2. Assign a button to call the macro

Here is the macro

Sub SaveAsPDF()
    With Dialogs(wdDialogFileSaveAs)
        .Format = wdFormatPDF
        .Show
    End With
End Sub

Paste this into the Normal > NewMacros module of VBA Explorer (Alt+F11).

enter image description here

Now select the drop down arrow of your Quick Access Toolbar and choose More Commands.... Now select Macros from the Choose commands from, select the macro, then add it to the right pane. You can modify the name and icon using the Modify Button at the bottom.

enter image description here

You now have a single button which will bring up the file save dialog (so you can name it) which will safe it to a PDF.

enter image description here

2
  • Read my answer. Do you really need a macro to solve such obvious and simple problem? :] – trejder Sep 17 '12 at 20:49
  • The only solution that works on Mac :) The only downside is that you cannot change its icon. – Derek 朕會功夫 Nov 23 '16 at 14:48
2

Also, once you've done that (added to quick menu) if you press ALT it should display what number the command is. You can then press ALT+Number and use the keyboard shortcut. I did what Westcoast recommended, and then when I press ALT it shows as number 4, so I press ALT+4 and it saves as PDF. Marvellous!

1
  • Nice, thanks for the detail on making ribbon customizations keyboard acceptable. – matt wilkie Mar 3 '15 at 18:11
1

I don't see this answer, so you should know it's very simple to add a CREATE PDF button to the Quick Access Toolbar (no Macros needed).

  • Go to the QAT and hit the dropdown arrow ...
  • Select MORE COMMANDS ...
  • In the resulting customization window, hit the dropdown menu for CHOOSE COMMANDS FROM ...
  • Select FILE TAB, which is about the 5th one down ...
  • Scroll down to find the entry "PUBLISH AS PDF OR XPS" ...
  • Add that selection to the QAT, and SAVE out....

Now you have your one button in the QAT. Hit that button and you get a Save-As window with PDF ready to go as the default file type (And XPS being another choice, if anyone ever cared about that.)

1
  • This is the same as the accepted answer (though admittedly that one does leave the "how to customize QAT" step by step as an additional research exercise). Thanks for contributing – matt wilkie Apr 3 '17 at 19:59
1

I have made a powershell script for this. Run this and click Install. Then right click any PDF file and go to Convert To (bottom) and click XPS button. No need to open Microsoft word, the converted file will be saved in current directory.

# Word2AnyInstall.ps1
#This script will install context menus on .DOC,.DOCX,.RTF,.PDF,.HTM,.HTML,.ODT,.XML,.XPS files to convert them to different # format using MS Word
#   Right-click any file in these extensions and you will get a menu abiove "Properties" use it
#   An MSI-based (not Click-To-Run) installation of MS Office is required, will work for Office 2007+ versions and even # Unactivated versions will work too
#   While conversion, just make sure that MS Word is not Open and please don't occupy C:\bin directory where files will be kept

$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if( -not ($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)))
{
    Write-Host "Running Admin Shell, Please wait....."
    Start-Sleep -Seconds 1
    Start-Process powershell.exe -ArgumentList "-ExecutionPolicy Bypass -File `"$($MyInvocation.MyCommand.Path)`"" -Verb RunAs
    Exit 0
}

function Install {
If (!(Test-Path C:\bin)){
  New-Item C:\bin -Type Directory
}

@'
Param(
    [System.IO.Fileinfo]$Source,
    [String]$Format
)
$arrFileExt = @{
     "doc"      =   0
     "docx"     =   0
     "htm"      =   8   
     "html"     =   8
     "odt"      =   23
     "pdf"      =   17  
     "rtf"      =   6
     "txt"      =   4
     "xml"      =   19
     "xps"      =   18
}
$myFileType = $arrFileExt."$Format"
$myFileName = $Source.Basename
$myFileExt = "." + $Format
$toSave = Split-Path "$Source"
$myOutputFile = $toSave + "\" + $myFileName + $myFileExt
$objWord = New-Object -COMObject "Word.Application" 
$objWord.Visible = $False
$objWord.Documents.Open([string]$Source) | Out-Null
$objDoc = $objWord.ActiveDocument
$objDoc.SaveAs("$myOutputFile",$myFileType) | Out-Null
$objDoc.Close() | Out-Null
'@ | Set-Content C:\bin\Word2Any.ps1

@'
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo]
"MUIVerb"="Convert To"
"Position"="Bottom"
"SubCommands"=""

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell]

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\001DOC]
"MUIverb"="Word document 1997-2003 (DOC)"
"Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe,-2"

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\001DOC\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"doc\""

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\002DOCX]
"MUIVerb"="Word document 2007-2019 (DOCX)"
"Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe"

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\002DOCX\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"docx\""

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\003PDF]
"MUIVerb"="Portable Document Format (PDF)"
"Icon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,13"

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\003PDF\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"pdf\""

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\004RTF]
"MUIVerb"="Rich Text Format (RTF)"
"Icon"="shell32.dll,1"

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\004RTF\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"rtf\""

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\005ODT]
"MUIVerb"="Open Document Text (ODT)"
"Icon"="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe,3"

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\005ODT\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"odt\""

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\006TXT]
"MUIVerb"="Plain Text File (TXT)"
"Icon"="shell32.dll,70"

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\006TXT\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"txt\""

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\007HTM]
"MUIVerb"="HTML webpage (HTM)"
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
  00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,\
  65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,\
  00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,\
  35,00,00,00

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\007HTM\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"htm\""

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\008HTML]
"MUIverb"="HTML webpage ()HTML)"
"Icon"="C:\\Program Files\\Internet Explorer\\iexplore.exe,17"

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\008HTML\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"html\""

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\009XML]
"MUIVerb"="XML File (XML)"
"Icon"="ieframe.dll,2"

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\009XML\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xml\""

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\010XPS]
"MUIVerb"="XPS File (XPS)"
"Icon"="D:\\Windows\\System32\\xpsrchvw.exe,2"

[HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo\shell\010XPS\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xps\""






[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo]
"MUIVerb"="Convert To"
"Position"="Bottom"
"SubCommands"=""

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell]

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\001DOC]
"MUIverb"="Word document 1997-2003 (DOC)"
"Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe,-2"

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\001DOC\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"doc\""

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\002DOCX]
"MUIVerb"="Word document 2007-2019 (DOCX)"
"Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe"

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\002DOCX\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"docx\""

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\003PDF]
"MUIVerb"="Portable Document Format (PDF)"
"Icon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,13"

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\003PDF\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"pdf\""

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\004RTF]
"MUIVerb"="Rich Text Format (RTF)"
"Icon"="shell32.dll,1"

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\004RTF\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"rtf\""

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\005ODT]
"MUIVerb"="Open Document Text (ODT)"
"Icon"="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe,3"

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\005ODT\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"odt\""

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\006TXT]
"MUIVerb"="Plain Text File (TXT)"
"Icon"="shell32.dll,70"

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\006TXT\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"txt\""

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\007HTM]
"MUIVerb"="HTML webpage (HTM)"
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
  00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,\
  65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,\
  00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,\
  35,00,00,00

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\007HTM\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"htm\""

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\008HTML]
"MUIverb"="HTML webpage ()HTML)"
"Icon"="C:\\Program Files\\Internet Explorer\\iexplore.exe,17"

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\008HTML\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"html\""

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\009XML]
"MUIVerb"="XML File (XML)"
"Icon"="ieframe.dll,2"

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\009XML\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xml\""

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\010XPS]
"MUIVerb"="XPS File (XPS)"
"Icon"="D:\\Windows\\System32\\xpsrchvw.exe,2"

[HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo\shell\010XPS\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xps\""









[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo]
"MUIVerb"="Convert To"
"Position"="Bottom"
"SubCommands"=""

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell]

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\001DOC]
"MUIverb"="Word document 1997-2003 (DOC)"
"Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe,-2"

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\001DOC\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"doc\""

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\002DOCX]
"MUIVerb"="Word document 2007-2019 (DOCX)"
"Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe"

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\002DOCX\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"docx\""

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\003PDF]
"MUIVerb"="Portable Document Format (PDF)"
"Icon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,13"

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\003PDF\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"pdf\""

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\004RTF]
"MUIVerb"="Rich Text Format (RTF)"
"Icon"="shell32.dll,1"

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\004RTF\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"rtf\""

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\005ODT]
"MUIVerb"="Open Document Text (ODT)"
"Icon"="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe,3"

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\005ODT\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"odt\""

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\006TXT]
"MUIVerb"="Plain Text File (TXT)"
"Icon"="shell32.dll,70"

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\006TXT\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"txt\""

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\007HTM]
"MUIVerb"="HTML webpage (HTM)"
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
  00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,\
  65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,\
  00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,\
  35,00,00,00

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\007HTM\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"htm\""

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\008HTML]
"MUIverb"="HTML webpage ()HTML)"
"Icon"="C:\\Program Files\\Internet Explorer\\iexplore.exe,17"

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\008HTML\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"html\""

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\009XML]
"MUIVerb"="XML File (XML)"
"Icon"="ieframe.dll,2"

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\009XML\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xml\""

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\010XPS]
"MUIVerb"="XPS File (XPS)"
"Icon"="D:\\Windows\\System32\\xpsrchvw.exe,2"

[HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo\shell\010XPS\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xps\""




[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo]
"MUIVerb"="Convert To"
"Position"="Bottom"
"SubCommands"=""

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell]

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\001DOC]
"MUIverb"="Word document 1997-2003 (DOC)"
"Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe,-2"

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\001DOC\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"doc\""

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\002DOCX]
"MUIVerb"="Word document 2007-2019 (DOCX)"
"Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe"

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\002DOCX\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"docx\""

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\003PDF]
"MUIVerb"="Portable Document Format (PDF)"
"Icon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,13"

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\003PDF\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"pdf\""

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\004RTF]
"MUIVerb"="Rich Text Format (RTF)"
"Icon"="shell32.dll,1"

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\004RTF\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"rtf\""

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\005ODT]
"MUIVerb"="Open Document Text (ODT)"
"Icon"="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe,3"

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\005ODT\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"odt\""

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\006TXT]
"MUIVerb"="Plain Text File (TXT)"
"Icon"="shell32.dll,70"

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\006TXT\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"txt\""

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\007HTM]
"MUIVerb"="HTML webpage (HTM)"
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
  00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,\
  65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,\
  00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,\
  35,00,00,00

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\007HTM\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"htm\""

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\008HTML]
"MUIverb"="HTML webpage ()HTML)"
"Icon"="C:\\Program Files\\Internet Explorer\\iexplore.exe,17"

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\008HTML\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"html\""

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\009XML]
"MUIVerb"="XML File (XML)"
"Icon"="ieframe.dll,2"

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\009XML\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xml\""

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\010XPS]
"MUIVerb"="XPS File (XPS)"
"Icon"="D:\\Windows\\System32\\xpsrchvw.exe,2"

[HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo\shell\010XPS\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xps\""





[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo]
"MUIVerb"="Convert To"
"Position"="Bottom"
"SubCommands"=""

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell]

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\001DOC]
"MUIverb"="Word document 1997-2003 (DOC)"
"Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe,-2"

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\001DOC\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"doc\""

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\002DOCX]
"MUIVerb"="Word document 2007-2019 (DOCX)"
"Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe"

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\002DOCX\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"docx\""

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\003PDF]
"MUIVerb"="Portable Document Format (PDF)"
"Icon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,13"

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\003PDF\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"pdf\""

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\004RTF]
"MUIVerb"="Rich Text Format (RTF)"
"Icon"="shell32.dll,1"

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\004RTF\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"rtf\""

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\005ODT]
"MUIVerb"="Open Document Text (ODT)"
"Icon"="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe,3"

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\005ODT\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"odt\""

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\006TXT]
"MUIVerb"="Plain Text File (TXT)"
"Icon"="shell32.dll,70"

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\006TXT\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"txt\""

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\007HTM]
"MUIVerb"="HTML webpage (HTM)"
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
  00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,\
  65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,\
  00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,\
  35,00,00,00

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\007HTM\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"htm\""

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\008HTML]
"MUIverb"="HTML webpage ()HTML)"
"Icon"="C:\\Program Files\\Internet Explorer\\iexplore.exe,17"

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\008HTML\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"html\""

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\009XML]
"MUIVerb"="XML File (XML)"
"Icon"="ieframe.dll,2"

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\009XML\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xml\""

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\010XPS]
"MUIVerb"="XPS File (XPS)"
"Icon"="D:\\Windows\\System32\\xpsrchvw.exe,2"

[HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo\shell\010XPS\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xps\""





[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo]
"MUIVerb"="Convert To"
"Position"="Bottom"
"SubCommands"=""

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell]

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\001DOC]
"MUIverb"="Word document 1997-2003 (DOC)"
"Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe,-2"

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\001DOC\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"doc\""

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\002DOCX]
"MUIVerb"="Word document 2007-2019 (DOCX)"
"Icon"="%ProgramFiles%\\Microsoft Office\\Office15\\WINWORD.exe"

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\002DOCX\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"docx\""

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\003PDF]
"MUIVerb"="Portable Document Format (PDF)"
"Icon"="C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe,13"

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\003PDF\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"pdf\""

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\004RTF]
"MUIVerb"="Rich Text Format (RTF)"
"Icon"="shell32.dll,1"

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\004RTF\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"rtf\""

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\005ODT]
"MUIVerb"="Open Document Text (ODT)"
"Icon"="C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe,3"

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\005ODT\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"odt\""

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\006TXT]
"MUIVerb"="Plain Text File (TXT)"
"Icon"="shell32.dll,70"

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\006TXT\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"txt\""

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\007HTM]
"MUIVerb"="HTML webpage (HTM)"
"Icon"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
  00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,74,00,65,00,72,00,6e,00,\
  65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,5c,00,69,\
  00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,65,00,78,00,65,00,2c,00,\
  35,00,00,00

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\007HTM\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"htm\""

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\008HTML]
"MUIverb"="HTML webpage ()HTML)"
"Icon"="C:\\Program Files\\Internet Explorer\\iexplore.exe,17"

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\008HTML\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"html\""

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\009XML]
"MUIVerb"="XML File (XML)"
"Icon"="ieframe.dll,2"

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\009XML\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xml\""

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\010XPS]
"MUIVerb"="XPS File (XPS)"
"Icon"="D:\\Windows\\System32\\xpsrchvw.exe,2"

[HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo\shell\010XPS\command]
@="powershell.exe -file C:\\bin\\Word2Any.ps1 \"%1\" \"xps\""

'@ | Set-Content C:\bin\wordsav.reg

regedit.exe /s C:\bin\wordsav.reg
}

function Uninstall {

@'
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Word.Document.12\shell\ConvertTo]
[-HKEY_CLASSES_ROOT\Word.Document.8\shell\ConvertTo]
[-HKEY_CLASSES_ROOT\Word.RTF.8\shell\ConvertTo]
[-HKEY_CLASSES_ROOT\Word.OpenDocumentText.12\shell\ConvertTo]
[-HKEY_CLASSES_ROOT\MSEdgePDF\shell\ConvertTo]
[-HKEY_CLASSES_ROOT\MSEdgeHTM\shell\ConvertTo]

'@ | Set-Content uninstall.reg

regedit /s uninstall.reg
Remove-Item C:\bin\Word2Any.ps1
Remove-Item C:\bin\wordsav.reg
Remove-Item C:\bin
}
[Console]::WindowWidth = 192
[Console]::Title = "Word2AnyInstall"
@'
################################################################################################################################################################
                       
                                                          Word2AnyInstall.ps1
   This script will install context menus on .DOC,.DOCX,.RTF,.PDF,.HTM,.HTML,.ODT,.XML,.XPS files to convert them to different format using MS Word
   Right-click any file in these extensions and you will get a menu abiove "Properties" use it
   An MSI-based (not Click-To-Run) installation of MS Office is required, will work for Office 2007+ versions and even Unactivated versions will work too
   While conversion, just make sure that MS Word is not Open and please don't occupy C:\bin directory where files will be kept

################################################################################################################################################################

'@
$msg = @'

[1] Install
[2] Repair
[3] Uninstall

'@
choice /c 123 /n /m $msg
switch ($LastExitCode) {
1 {Install}
2 {Install}
3 {Uninstall}
}

Write-Host "`nDone!"
Read-Host
0

You could do this or another similar process to customize the ribbon - create a new group and add to that...

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.