need help with form programming - print command button

G

Guest

Environment: Outlook 2003 SP2, Exchange 2003

Form: IPM.Note message class. For a Leave Request to be forwarded multiple
times (to be approved by supervisor and sent to HR etc)

Im using the following code for a print button:

Function print_Click()
cmdPrint_Click
End Function

Dim strTemplate
Dim objWord
Dim objDocs
Dim strField
Dim strField1

Sub cmdPrint_Click

Set objWord = CreateObject("Word.Application")

'Template file name and location
strTemplate = "leave.dot"
strTemplate = "m:\" & strTemplate

Set objDocs = objWord.Documents
objDocs.Add strTemplate
set mybklist = objWord.ActiveDocument.Bookmarks

For counter = 1 to mybklist.count
strField = objWord.ActiveDocument.Bookmarks(counter)
objWord.ActiveDocument.Bookmarks(strField).Select

'Find fields to print
strField1 = Item.UserProperties.find(strField).value
If strField1 = True then
strField1 = "Yes"
ElseIf strField1 = False then
strField1 = "No"
End If

objWord.Selection.TypeText Cstr(strField1)

Next
objWord.PrintOut Background = True
objWord.Quit(0)

End Sub


The way my form works is this; an employee opens the form, fills in the
relevant info and sends it to their supervisor. Their supervisor then sees
an approval box etc selects approved/disapproved and forwards it onto the
HR/payroll people. The problem is that when they receive it the form is no
longer interactive. The print button does absolutely nothing, and neither
does my calculate button which works out the amount of working days between
two dates.

I did notice that at that point the icon in OL changes from a yellow note
with a pin in it (which is what the first recipient sees) to the normal
envelope (which the final recipient sees).

How can I get this to work properly? Does it have something to do with
sending the form definition? I currently have that UNCHECKED. If I check it
will it render any other programming I've put in as useless? I dont know all
that much about it yet.

Thanks
Wayne
 
S

Sue Mosher [MVP-Outlook]

Make sure that the Forward action on the (Actions) page is set to use your published custom form.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

Beautiful thanks.

It didnt work straight away (just in case this happens to anyone else), but
after I cleared the cache it worked fine.
 

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