How to set the active printer in late binding for word.application using C#?

Try the following, cannot work:
Parameters = new Object[2];
Parameters[0] = printername;
Parameters[1] = 1;

String[] argNames = new String[] { "Printer", "DoNotSetAsSysDefault" };

wordApplication.GetType().InvokeMember("FilePrintSetup",
BindingFlags.InvokeMethod, null, wordApplication, Parameters, null, null,
argNames);

Thanks.

Re: Set Active Printer using automation in word for C# by jedrake

jedrake
Wed Aug 08 22:37:27 CDT 2007

On Jun 25, 11:43 am, HowPK <Ho...@discussions.microsoft.com> wrote:
> How to set the active printer in late binding for word.application using C#?
>
> Try the following, cannot work:
> Parameters = new Object[2];
> Parameters[0] = printername;
> Parameters[1] = 1;
>
> String[] argNames = new String[] { "Printer", "DoNotSetAsSysDefault" };
>
> wordApplication.GetType().InvokeMember("FilePrintSetup",
> BindingFlags.InvokeMethod, null, wordApplication, Parameters, null, null,
> argNames);
>
> Thanks.

You missed wordApplication.WordBasic that should do it for you.