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?