How to execute VBA function in MS Word?



I would like to know if it is possible to run VBA function with parametr in MS Word,

Public Function Test (sTestString As String)
ActiveDocument.Range.Paragraphs(1).Range.Text = sTestString
End Function



This doesn’t sound like a UIpath query. Please refer below link:


Not easily at present although you could physically open the Word document and execute the macro.

Coming soon is the ability to write bespoke code in UiPath which would also allow the creation of VB.Net functions that could complete the same task.

@badita probably worth considering an Execute Macro activity for MSWord as there may already be complex macros in a Word document that you need to call.


MS Word change page orientation