W
Wayne
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
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