2

How can I pass parameters to a com-object function by name rather than by position?

Specifically, I've a com-object function (Word document com-object SaveAs2) and for example I want to pass values to the 2 first parameters and to the last parameter (CompatibilityMode).

2
  • Don't think it can be done. You can shortcut it somewhat though: $Arglist = "Document.docx",16 + (,$null*14) + 12 Feb 16, 2015 at 11:25
  • 1
    @MathiasR.Jessen Neat idea, but I'm still hopeful. I've sent this to "The Scripting Guys" as well.
    – EliadTech
    Feb 16, 2015 at 14:11

1 Answer 1

1

See this answer on Stackoverflow (short answer - you cannot directly):

https://stackoverflow.com/questions/5544844/how-to-call-a-complex-com-method-from-powershell

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .