1

We need to do some text search on word doc, and use below lines of code to open document. I got the code running on two laptops, in one it doesn't open wordapp and in other it does.

$objWord = New-Object -Com Word.Application
$objWord.Visible = $false 
$objDocument = $objWord.Documents.Open($filename)
$objDocument.Close()
$objWord.Quit()
# Stop Winword Process
$rc = [System.Runtime.Interopservices.Marshal]::ReleaseComObject($objWord)

Is there any other way of opening document, as this open WORD DOC application which we don't want that. How to scan document without letting Word application open?

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
user3657339
  • 607
  • 2
  • 9
  • 20
  • 2
    Possible duplicate of [Read the word document conent without using Microsoft office](https://stackoverflow.com/questions/20835177/read-the-word-document-conent-without-using-microsoft-office) – AdamL Jul 18 '18 at 11:33
  • 1
    Use [Powertools](https://archive.codeplex.com/?p=powertools) – Ranadip Dutta Jul 18 '18 at 12:50

0 Answers0