::GetNames() | ForEach | Format-Wide -Property Style -Column 4 So lets start with a fresh slate (actually I am just going to delete all of the words here instead of rebuilding the object) and look at some of the Styles that we can use.įirst off, we should see what kind of styles are available to use. We work around this by calling TypeParagraph(). If I attempt to do this again, it will not actually start on the next line but append to the existing line. Ok, nothing really mind blowing here, but this is how we can write in word using PowerShell. Writing to word is as simple as calling TypeText() and supplying a parameter which is text. I then want to select the current pane in Word so I can begin writing data to it. I am keeping the output of this saved to another variable that will be used later on. We do this by calling the Documents.Add() method. But we don’t actually have a document loaded yet to start writing. To make Word visible, we have to set the Visibility of the object to $True. One thing that you might note is that we can’t see Word opened up, even though the process is actually active. Now I have created my object as shown in the image below. $Word = New-Object -ComObject Word.Application Like any COM object, we must use New-Object with the –ComObject parameter to tell PowerShell that we are loading up a Com object. I will be using Word 2013 in this article, so your mileage may vary if using older versions. This first article will dip our toes into creating the Word Com object, looking at sending text to Word and adjusting some of the various fonts and styles to give you a stepping stone on what you can do.