The text of a Microsoft Word document can be extracted and stored into a Variable using VBScript.


The above can be achieved by implementing the following VBScript code into a "Run VBScript" Action:


Dim Word
Dim WordDoc
Dim var
Set Word = CreateObject("Word.Application")

'Open the Document
Set WordDoc = Word.Documents.open("%SelectedFile%")

NumberOfWords = WordDoc.Sentences.count
For i = 1 to NumberOfWords
WScript.Echo WordDoc.Sentences(i)
Next
' Close Word
WordDoc.Save
Word.Quit
'Release the object variables
Set WordDoc = Nothing
Set Word = 
Nothing



Should you want to save the file on a certain location, you can use the following syntax:

WordDoc.SaveAs("C:\...\WordDocument.docx")



Note: Using the "Parse Text" or "Replace Text" Actions, you can further manipulate the extracted text.

You may have to use regular expressions to target specific text (strings). Refer to the screenshots attached for the script and actions.