Printing from a button

J

Jimbo

I need a row of buttons that print various views. Each button will have a
view to print then return to the main form. I just get this working. Anybody
willing to help?
 
F

Franck Dauché

Hi,

You can use code to do this (C# for example):
To Switch View:
thisXDocument.View.SwitchView("MyViewName");
To print:
thisXDocument.PrintOut();

Regards,

Franck Dauché
 
J

Jimbo

How about in Visual Basic?

Franck Dauché said:
Hi,

You can use code to do this (C# for example):
To Switch View:
thisXDocument.View.SwitchView("MyViewName");
To print:
thisXDocument.PrintOut();

Regards,

Franck Dauché
 
F

Franck Dauché

Hi,

In VB, the 2 lines become:
thisXDocument.View.SwitchView("MyViewName")
thisXDocument.PrintOut()

Regards,

Franck Dauché
 
F

Franck Dauché

OK, from your other post, it looks like you are after VBScript.
Use XDocument instead of thisXDocument in my previous post.
For the .PrintOut, your form will have to be fully trusted.

Regards,

Franck Dauché
 
J

Jimbo

Thanks Franck,
I switched to Visual Basic using Visual Studio. I have to install using
RegForm, it works. Thanks for you help
 
F

Franck Dauché

You are welcome.

Good luck with your InfoPath developments. Don't hesitate to open a new
thread if you have any other issue.

Regards,

Franck Dauché
 

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