M
Me
Hi there,
I use the word template solution tu print outlook custom form:
Set oWordApp = CreateObject("Word.Application")
If oWordApp Is Nothing Then
MsgBox "Couldn't start Word."
Else
Dim bolPrintBackground
Dim template
template = "http://whatever/mytemplate.dot"
Set oDoc = oWordApp.Documents.Add(template)
strMyField = Item.UserProperties.Find("thisproperty")
oDoc.Bookmarks("thisproperty").Range.InsertAfter strMyField
'..Add all properties...
bolPrintBackground = oWordApp.Options.PrintBackground
oWordApp.Options.PrintBackground = False
oDoc.PrintOut
oWordApp.Options.PrintBackground = bolPrintBackground
Const wdDoNotSaveChanges = 0
oDoc.Close wdDoNotSaveChanges
oWordApp.Quit
Set oDoc = Nothing
Set oWordApp = Nothing
End If
But for some users it cause Outlook to crash quite frequently (Outlook
has to quit blablabla...) It happen mostly when user click the print
button that call this function then click to close the form before
printing is done (it might takes a few seconds), then Outlook crashes.
There's no common point between the few users who got this problems
(Some has Outlook XP SP3, some has Outlook 2003, some has good
machine, some has older computers) so I don't know...
I know using word templates to print outlook forms is a really common
solution, has anybody ever face this problems ?
Thx for your help !
I use the word template solution tu print outlook custom form:
Set oWordApp = CreateObject("Word.Application")
If oWordApp Is Nothing Then
MsgBox "Couldn't start Word."
Else
Dim bolPrintBackground
Dim template
template = "http://whatever/mytemplate.dot"
Set oDoc = oWordApp.Documents.Add(template)
strMyField = Item.UserProperties.Find("thisproperty")
oDoc.Bookmarks("thisproperty").Range.InsertAfter strMyField
'..Add all properties...
bolPrintBackground = oWordApp.Options.PrintBackground
oWordApp.Options.PrintBackground = False
oDoc.PrintOut
oWordApp.Options.PrintBackground = bolPrintBackground
Const wdDoNotSaveChanges = 0
oDoc.Close wdDoNotSaveChanges
oWordApp.Quit
Set oDoc = Nothing
Set oWordApp = Nothing
End If
But for some users it cause Outlook to crash quite frequently (Outlook
has to quit blablabla...) It happen mostly when user click the print
button that call this function then click to close the form before
printing is done (it might takes a few seconds), then Outlook crashes.
There's no common point between the few users who got this problems
(Some has Outlook XP SP3, some has Outlook 2003, some has good
machine, some has older computers) so I don't know...
I know using word templates to print outlook forms is a really common
solution, has anybody ever face this problems ?
Thx for your help !