![]() |
need help with form programming - print command button
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 |
need help with form programming - print command button
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 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Wayne" wrote in message ... 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 |
need help with form programming - print command button
Beautiful thanks.
It didnt work straight away (just in case this happens to anyone else), but after I cleared the cache it worked fine. "Sue Mosher [MVP-Outlook]" wrote: 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 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Wayne" wrote in message ... 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 |
All times are GMT +1. The time now is 08:48 PM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com