Solved

Get Word Document contents into variable with Powershell

Posted on 2013-02-01
1
1,358 Views
Last Modified: 2013-02-18
I am looking for a way to get a Word Documents contents into a powershell variable. Ideas?
0
Comment
Question by:Blowfelt82
1 Comment
 
LVL 17

Accepted Solution

by:
Barry Cunney earned 500 total points
ID: 38844369
$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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question