Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use Windows PowerShell to Open Word Document

$
0
0

Summary: Learn how to use Windows PowerShell to open a Microsoft Word document.

Hey, Scripting Guy! Question How can I open a Word document with Windows PowerShell?

Hey, Scripting Guy! Answer Use the New-Object cmdlet:

$Filename='C:\HappyBirthdayEd.docx'

$Word=NEW-Object –comobject Word.Application

$Document=$Word.documents.open($Filename)

You can now programmatically access methods and properties to edit the Word document.


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>