M
Mark Eastom
Outlook 2000 / Windows 2000.
I've written a small VB application that uses the Outlook
Object Model to open and automatically print MailItems.
I managed to work around the various quirks in HTML
formatted MailItem printing until I came across some mail
items that appear to contain scripts and "dead" links.
When the PrintOut method is called after the program opens
such a message the Outlook window pops up a message
stating "Items In This Message Are Still Loading".
I found the Knowledge Base and found article 270142 which
claims the resolution is "To print the page, wait until
the contents of the page are completely displayed, and
then click Print on the File menu."
I decided to test that by opening the message manually
within Outlook. Unfortunately, even after roughly an hour
of repeated attempt to manually print the message it
apparently never gets to the point of being "completely
displayed". On the final attempt to print the message
Outlook simply shut itself down.
I can manually save the message as an HTML file, then open
it within IE and print it. Unfortunately it wouldn't
actally look like it had been printed from Outlook.
Programattically detecting the the MailItem never
successfully being display via the Outlook Object Model
doesn't appear to be possible form what I can tell, though
If I could do that it wouldn't be too tough to use the
SaveAs method on the the MailItem object to create the
HTML file and print it via automation from IE.
Is there any sort of setting for Outlook (in the registry
or anywhere) that can tell it to have a "reasonable"
timeout value when trying to rendor HTML formatted
messages of that nature?
Any other suggestons?
The only seemingly "viable" alternative that I can think
of off hand since detecting and recovering from that error
vian the Outlook Object Model would be to simply "assume"
all HTML formatted MailItem are going to behave poorly,
then save them as HTML files and move on to using the IE
Obect Model to print them - which isn't TOO palatable at
the moment.
I've written a small VB application that uses the Outlook
Object Model to open and automatically print MailItems.
I managed to work around the various quirks in HTML
formatted MailItem printing until I came across some mail
items that appear to contain scripts and "dead" links.
When the PrintOut method is called after the program opens
such a message the Outlook window pops up a message
stating "Items In This Message Are Still Loading".
I found the Knowledge Base and found article 270142 which
claims the resolution is "To print the page, wait until
the contents of the page are completely displayed, and
then click Print on the File menu."
I decided to test that by opening the message manually
within Outlook. Unfortunately, even after roughly an hour
of repeated attempt to manually print the message it
apparently never gets to the point of being "completely
displayed". On the final attempt to print the message
Outlook simply shut itself down.
I can manually save the message as an HTML file, then open
it within IE and print it. Unfortunately it wouldn't
actally look like it had been printed from Outlook.
Programattically detecting the the MailItem never
successfully being display via the Outlook Object Model
doesn't appear to be possible form what I can tell, though
If I could do that it wouldn't be too tough to use the
SaveAs method on the the MailItem object to create the
HTML file and print it via automation from IE.
Is there any sort of setting for Outlook (in the registry
or anywhere) that can tell it to have a "reasonable"
timeout value when trying to rendor HTML formatted
messages of that nature?
Any other suggestons?
The only seemingly "viable" alternative that I can think
of off hand since detecting and recovering from that error
vian the Outlook Object Model would be to simply "assume"
all HTML formatted MailItem are going to behave poorly,
then save them as HTML files and move on to using the IE
Obect Model to print them - which isn't TOO palatable at
the moment.