Posts

Showing posts with the label word

Easily access linked files in Word/Office

Image
Problem: With the constant changes in the Office User Interface, it's gets increasingly difficult to find things. One feature that I am particularly annoyed about is the linked files. Whenever a user has a document with links to external documents, I never seem to find how to manage them. Solution: As usual, the complete list of commands comes to the rescue. Simply by going to File > Options > Quick Access Toolbar, we can see a list with commands, and if we pick "All commands", we will now find " Edit Links to Files " and bring it to the right for a quick shortcut on the top left.

Export Word document to image files

Problem: How to convert a word (.doc, .docx) document to an image, or set of images? Solution: - Install pdfcreator - Right-click a word document and chose "create pdf and bitmap files with pdf creator" One-time settings: - Click "options" in the pdf creator dialog - In "document", select "one page per file (except pdf and eps)" - In "save", select "PNG" as the default format - Click save and watch your png image files being created, one for each document page

Word | Resize all images simultaneously

Situation: You have hundreads of images in a word document. You want to grab them all, and set the same width and height. Solution: - Open Developer Tab (may require activating it on Word Options, Popular, "Show Developer tab in the ribbon") - Create a new macro Public Sub ResizePics() Dim oDoc As Document, oShape As InlineShape Set oDoc = Application.ActiveDocument For Each oShape In oDoc.InlineShapes oShape.Height = 270 oShape.Width = 360 Next oShape Set oDoc = Nothing End Sub Remember to convert cm's to pixels http://www.translatorscafe.com/cafe/units-converter/typography/calculator/pixel-%28X%29-to-centimeter-%5Bcm%5D/

PowerShell | Word fails to open documents as a background service

System: Windows 2008 Server Environment: PowerShell + Microsoft.Office.Interop.Word.ApplicationClass (word.application) (as a task in Task Scheduler) Issue: Word fails to open document in method: $docxPath = gci "myfile.docx" $wordApp = New-Object -Com Word.Application $wordApp.Visible = $false $wordDoc = $wordApp.Documents.Open($docxPath.FullName) Solution: As CRAZY as it sounds, the solution is to CREATE AN EMPTY FOLDER called "Desktop" in either: C:\Windows\SysWOW64\config\systemprofile\Desktop or C:\Windows\System32\config\systemprofile\Desktop ...depending on whether you have 64-bit Windows. http://stackoverflow.com/questions/1177974/word-interop-not-working-in-a-scheduled-task

PowerShell | How to know if an Application is installed?

Let's find out if Microsoft Word is installed on the system: if ((dir REGISTRY::HKEY_CLASSES_ROOT\Word.Application) -ne $Null) { #do word installed stuff such as $myWord = New-Object -Com Word.Application $myWord.Visible = $true } Another option would be to catch the exception launched from the failed new-object Thanks to http://www.virtu-al.net/2008/08/07/powershell-is-microsoft-word-installed/