I am trying to use the Invoke Method for saving a word document without having to use the invoke code activity due to restrictions set by my workplace. I have the following variables created and am trying to save the word document after it sends the text to Word
Hi @j1osu2006 ,
Step 1: Create a new Invoke Method activity
Step 2: Set the TargetObject to doc (your Word document object)
Step 3: Set the MethodName to “SaveAs2”
Step 4: Add a parameter:
Direction: In
Type: String
Value: docPath
This will call doc.SaveAs2(docPath) internally.
Step 5(optional) To clean up resources, use two more Invoke Method activities:
Close the document:
TargetObject: doc
MethodName: Close
Quit Word:
TargetObject: wordApp
MethodName: Quit
If this solves your query kindly, close this case by marking it as solution.
I’m getting the following error on the invoke method for SaveAs2:
Document does not have a public instance method named SaveAs2 matching the parameter type, generic type arguments, and generic type constraints supplied to InvokeMethod ‘invoke Method”.