Daniil Romme
Daniil Romme

Reputation: 69

Powershell import Microsoft.Office.Interop.Word.dll

So I am interested in Microsoft.Office.Interop.Word Namespace, cause in powershell we can read doc file via COM interface but I have a difficult task that needs doing without install Microsoft office. Well how can I read doc file with Microsoft.Office.Interop.Word.dll?

[string]$assemblyPath = '.....\Microsoft.Office.Interop.Word.dll'
# Load assembly and suppress output
[void]([System.Reflection.Assembly]::LoadFrom($assemblyPath))
[System.Reflection.Assembly]::LoadFrom($assemblyPath)

Upvotes: 1

Views: 1238

Answers (1)

JPBlanc
JPBlanc

Reputation: 72640

You can use Microsoft Word COM, only if Word is installed on the computer.

You can consider using DocumentFormat.OpenXml Nuget Package

Upvotes: 1

Related Questions