How to set the ActivePrinter Property for Microsoft.Office.Interop

V

Vinu

I've created the Microsoft.Office.Interop.Excel.ApplicationClass instance
using following code.

theServer = Activator.CreateInstance(ServerType);

private static Type ServerType { get { return
Type.GetTypeFromProgID("Excel.Application"); } }
Type typeof_Server = theServer .GetType();
typeof_Server.InvokeMember("ActivePrinter", BindingFlags.SetProperty, null,
theServer ,new object[] { "MyPrinter on Ne03:" });

I'm not able to set printer property for this instance using the above code.
It gives an exception unable to set the ActivePrinter Property for the
ApplicationClass.

In MSDN the ActivePrinter property for
Microsoft.Office.Interop.Excel.ApplicationClass instance has following
description.
public virtual string ActivePrinter {get; set;}This property supports the
..NET Framework infrastructure and is not intended to be used directly from
your code.

How do i set it.

Thanks
Vinu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top