[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2104
  • Last Modified:

Get Word Document contents into variable with Powershell

I am looking for a way to get a Word Documents contents into a powershell variable. Ideas?
0
Blowfelt82
Asked:
Blowfelt82
1 Solution
 
Barry CunneyCommented:
$word = New-Object -comobject Word.Application
$word.Visible = $True
$doc = $word.Documents.Open("C:\Scripts\Test.doc")
$body_content = $doc.Paragraphs.Range.Text
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now