K
Kristy
Hi
I have created a com addin for Outlook 2000/XP. Bascially the
application creates HTML emails using templates for marketing
purposes, they almost always contain embedded graphics (logo's etc).
Many of my customers like to automatically print Sent messages that
meet certain criteria, one of these is if any attachments are
included.
Currently I use a custom "button" called Send and Print that when
clicked will check for attachments, if any exist I add an attachments
list to the bottom of the message (since HTML messages don't print
attachment icons), then create a custom tag (so that I can identify it
later) and send it.
There is an event on the Sent Items folder which checks new items for
my custom field, if it exists then the message is printed using the
item.printout method.
The problem is that if I don't display it it prints but without the
graphics (box and cross)... fair enough I thought, I need to display
the email before I print it to ensure that the graphics get embedded,
and then print it and close it again... this doesn't work? I am
getting an error about the email still loading try again later? How
can I get around this since I have to display the message to be able
to print the graphics. I obviously get a new inspector on displaying
the message but can't find anywhere to put the printout method that
makes any difference?????
I hope that I am missing something really obvious here, and someone
can help me. Any points, tips, tricks, advice greatly appreciated
The following is a code sample of the printing bit...
Private Sub colSentItems_ItemAdd(ByVal item As Object)
Set oMailItem = item
Set utils = CreateObject("Redemption.MAPIUtils")
CustomField = utils.HrGetOneProp(oMailItem.MAPIOBJECT, PrCustomTag)
If CustomField = "Print Attachments" Then
oMailItem.Display 'this creates a new inspector
item.PrintOut
oMailItem.Close (olSave)
End If
End Sub
Cheers
Kristy
I have created a com addin for Outlook 2000/XP. Bascially the
application creates HTML emails using templates for marketing
purposes, they almost always contain embedded graphics (logo's etc).
Many of my customers like to automatically print Sent messages that
meet certain criteria, one of these is if any attachments are
included.
Currently I use a custom "button" called Send and Print that when
clicked will check for attachments, if any exist I add an attachments
list to the bottom of the message (since HTML messages don't print
attachment icons), then create a custom tag (so that I can identify it
later) and send it.
There is an event on the Sent Items folder which checks new items for
my custom field, if it exists then the message is printed using the
item.printout method.
The problem is that if I don't display it it prints but without the
graphics (box and cross)... fair enough I thought, I need to display
the email before I print it to ensure that the graphics get embedded,
and then print it and close it again... this doesn't work? I am
getting an error about the email still loading try again later? How
can I get around this since I have to display the message to be able
to print the graphics. I obviously get a new inspector on displaying
the message but can't find anywhere to put the printout method that
makes any difference?????
I hope that I am missing something really obvious here, and someone
can help me. Any points, tips, tricks, advice greatly appreciated
The following is a code sample of the printing bit...
Private Sub colSentItems_ItemAdd(ByVal item As Object)
Set oMailItem = item
Set utils = CreateObject("Redemption.MAPIUtils")
CustomField = utils.HrGetOneProp(oMailItem.MAPIOBJECT, PrCustomTag)
If CustomField = "Print Attachments" Then
oMailItem.Display 'this creates a new inspector
item.PrintOut
oMailItem.Close (olSave)
End If
End Sub
Cheers
Kristy