Using XPrint and multiple Command Buttons to Print Multiple Pages

J

Justin714

Just wanted to use the XPrint control to print this multi-paged custom
form. It worked great for print the first page but with my limited
knowledge of VBScript I am running into problems. I have a XPrint
control on each page as well a command buttons:

XPrint1 for the page titled "RMA" and command button named "cmdPrint"
XPrint2 for the page titled "Credit Request" and command button named
"cmdPrint2"

I keep getting an error that "obect requirred: 'objXPrint1'". Anyone
have any suggestions?

Enviornment = Exchange 2003, Outlook 2003, Windows XP Pro

Here is the script I am using:

''Created By Justin Doe on 9/28/05 to enable printing as it appears on
Custom Forms
''Got the basic Code from:
http://support.microsoft.com/kb/230512/EN-US/
''Modified By Justin Doe 9/29/05 to print multiple pages

''Print RMA Page
Dim objInsp
Dim objPage1
Dim objXPrint1

Function Item_Open()
Set objInsp = Item.GetInspector
Set objPage1 = objInsp.ModifiedFormPages("RMA")
Set objXPrint1 = objPage1.XPrint1
objXPrint1.Preview = True
objXPrint1.Controls = objPage1.Controls
End Function

Sub cmdPrint_Click()
objXPrint1.PrintForm
End Sub

''Print Credit Request Page
Dim objPage2
Dim objXPrint2

Function Item_Open()
Set objInsp = Item.GetInspector
Set objPage2 = objInsp.ModifiedFormPages("Credit Request")
Set objXPrint2 = objPage2.XPrint2
objXPrint2.Preview = True
objXPrint2.Controls = objPage2.Controls
End Function

Sub cmdPrint2_Click()
objXPrint2.PrintForm
End Sub
 

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