Outlook HTML MailItem PrintOut method

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.
 
K

Karen Parker

If you have many graphics, etc that need to be downloaded for your message,
then I would expect that the message could take some time to render
depending on your internet connection. When I am testing printing of HTML
messages containing simple HTML to complex HTML with embedded graphics, I
do not experience any problems. If I understand your message correctly,
this problem also occurs when manually opening the message and manually
printing it via File | Print.

Can you reply with an attachment of the code that you are using and a
sample message item that reproduces the problem? Also, what is the build
of Outlook that you are using. This can be found via Help | About
Microsoft Outlook.

You may also find the following article useful in terms of printing Outlook
forms.
OL2000: Outlook Does Not Print Forms as Expected (230512)
<http://support.microsoft.com/?id=230512>

I hope the information that I provided here has been helpful to you.

Karen Parker
Microsoft, Developer Support Engineer - Windows Messaging / Outlook

Please do not send email directly to this alias. This alias is for
newsgroup purposes only.

Disclaimer: This posting is provided "AS IS" with no warranties, and
confers no rights.
--------------------
 
K

Karen Parker

Can you send me as an attachment one of the affected messages to test?

Karen Parker
Microsoft, Developer Support Engineer - Windows Messaging / Outlook

Please do not send email directly to this alias. This alias is for
newsgroup purposes only.

Disclaimer: This posting is provided "AS IS" with no warranties, and
confers no rights.
--------------------
 
K

Karen Parker

Mark,

I realize that the specific items that you are working with that reproduce
the problem may contain customer proprietary information. Can you
reproduce the problem with other non-sensitive data that is similar in
nature? It sounds like the problem could be related to these specific
items as I cannot reproduce the problem. Also, I see that you are running
an older build of Outlook 2000 (SR1, 9.0.0.3821). Can you install SP2 and
test to see if this still reproduces the problem? You may also want to
test using the CreateItemFromTemplate method to open the saved MSG file. I
also sent you printing alternatives using Word templates which may present
a workaround.

Newsgroup support is designed to allow the public to be able to respond.
If information that is crucial to solve your problem cannot be sent here,
then I recommend that you open a support incident to address your specific
problem where the details can be disclosed. For information on how to open
a case, please refer to the following links:
<http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS> or
<http://support.microsoft.com/default.aspx?scid=fh;EN-US;OfferProPhone>

Karen Parker
Microsoft, Developer Support Engineer - Windows Messaging / Outlook

Please do not send email directly to this alias. This alias is for
newsgroup purposes only.

Disclaimer: This posting is provided "AS IS" with no warranties, and
confers no rights.
--------------------
 
M

Mark Eastom

Karen,

Thanks for your input.

I'll log into my MSDN Universal sbscription to locate and download Outlook
Service Pack 2 - I haven't done that before now because my client is always
reluctant to make such changes to their production machines.

Partially because of the time it wold take to install it on all of their
production macines, and partially because of a pervasive (ongoing) paranoia
regarding problems caused my MS patches and services packs in the past.

I will also try to make time to see if I can't create an alternate
non-proprietary message that exhibits the same problems that I can make
available to you.

In the meantime, for what its worth, I was able to work around tthe problem
by using MAPI to read the PR_RTF_COMPRESSED property of the email messages
to get the obscured RTF-HTML text, convert it from that format to standard
HTML, add the to / from / sent / subject information as a header (in a
similar manner as done when saving as message as HTML from within Outlook)
and they are able to print the HTML files via alternate methods than Outlook
now withiout getting the permanent "wait for all items to be loaded" type
problem.
 
M

Mark Eastom

I noticed that there is no Outlook SP2, however there is an Office SP2 and
SP3.

Do you want me to try SP3 instead of SP2?

Or perhaps SP2, then SP3 to see if either makes a difference?

----------------------------
 
M

Mark Eastom

FWIW: Installing office 2000 service pack 2 made no difference in this
behavior.

Regarding opening a support incident, I was able to resolve this (in a
round-about manner) as I described in my earlier response here.

I have, however, tried opening other incidents using my MSDN "free"
incidents and even though the online message says they will contact me
within 24 hours.

I have never had them actually contact me.

I even tried opening one twice in the past week, and have been waiting for
nearly a full week on a response.

That doesn't give me a lot of faith in MS support.

----------------
 
K

Karen Parker

Mark,

Newsgroups are available to help answer questions that might not need
robust testing and investigation to resolve. I suggested that you open a
Microsoft Problem Resolution Services support incident. This is NOT the
same thing as posting to a newsgroup. By opening a support incident you
will receive a unique case number (i.e.: SRX123456789012) and a Microsoft
support professional to work with you on your issue. If you did do this
and received a case number, let me know and I can track down what happened.

Based on the problem you are experiencing, it sounds like more
troubleshooting and testing needs to be done to determine what is the
problem and what available workarounds you have. If you are not satisfied
with the workaround you have already found, I would again suggest that you
consider opening a support incident to address the problem. To fully
investigate this issue you will need to be able to provide data that
demonstrates the problem. This is the advantage to having a support
incident as you will have additional means to transfer data that will only
be accessible to the individuals involved in your case (MS only).

Again for your reference:
<http://support.microsoft.com/default.aspx?scid=fh;EN-US;OfferProPhone>
<http://support.microsoft.com/default.aspx?scid=fh;[ln];msservices>


Karen Parker
Microsoft, Developer Support Engineer - Windows Messaging / Outlook

Please do not send email directly to this alias. This alias is for
newsgroup purposes only.

Disclaimer: This posting is provided "AS IS" with no warranties, and
confers no rights.
--------------------
 
M

Mark Eastom

My last response to this issue was more in response to you suggestion to
attemp installing service pack two in order to resolve the issue within
Outlook. I simply wanted to let you know that it made no difference in the
behavior on the machines.

As I said, I did come up with a workaround that is good enough, and in fact
actually allows for faster procesing than trying to use the Outlook
automtion interfaces.



The comment regarding attempts to open MS-Support instances was a separate
issue concerning your other suggestion to open a new incident. I didn't
need to for this particular issue, but have tried to do so in the past using
the web-site with no success even though the site has said they will contact
me within 24 hours using the supplied email address.

For another more obtuse issue with Outlook and MS-Word I attempted a few
times over the past week of also trying to open an incident with their
online site. These attempts to open incidents were not responded to within
24 hours as the web site says will happen, and indeed hadn't been responded
to within a week.

While I was ought of town yesterday I did recieve a voice mail message from
someone in MS-Support stating that the request had been floating around at
MS until they finally handed it to someone.

The online site for opening incidents has a number of awkward issues of its
own.

It forces you to select a single product that you're having problens with,
which in the case of such things as automation involving multiple products
you're basically going to have a 50% chance at best of selecting the product
that is truly at issue (if indeed the combination of multiple products isn't
the problem.) This is apparently what caused the delay in them contacting
me - they couldn't decide on whom to give the incident to in their support
group(s).

The virtually all of text boxes for entering your information are very
limited so you can't give much information regarding the issue(s) at hand,
especially when 2 (or more) MS products are involved in the problem.

There doesn't appear to be (at least not that I could find) a page for
opening an incident using one of your "free" MSDN incidents, and the phone
numbers supplied only list that they are for "paid" incidents to be opened.


Thanks for you time and suggestions, sorry for any confusion I've caused in
this posts.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top