Solved

Display a specific Outlook message  in a WebBrowser control ( formatted as I see it  in Outlook)

Posted on 2014-02-05
3
351 Views
Last Modified: 2014-02-11
After the usual searches I only got this old code that does not run anymore (CreateTempMht does not exist in email class):

 string mhtFilename = email.CreateTempMht("c:/MailClientData/temp/temp.mht");
    if (mhtFilename == null)
    {
        MessageBox.Show(email.LastErrorText);
        return;
    }
      
    // Load the MHT in the WebBrowser:
    webBrowser1.Navigate("file:///C:/MailClientData/temp/temp.mht");


Any Help?
0
Comment
Question by:novreisb
  • 2
3 Comments
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 39838098
you can save the mht as an attachment but it probably will be blocked by outlook.
0
 

Accepted Solution

by:
novreisb earned 0 total points
ID: 39839742
Hi David,
It was not easy for me to put the msg in webbrowser control, so I made the option the most  easy (not the best option, but it works for a "Proof of Concept" programmer like me).
I save it as msg file and open it at once

mail.SaveAs(@"C:\temp\" + ID + ".msg", Outlook.OlSaveAsType.olMSG);
                outlook1.Session.OpenSharedItem(@"C:\temp\" + ID + ".msg");
                mail.Display(true);
                Marshal.ReleaseComObject(mail);

Thks anyway
0
 

Author Closing Comment

by:novreisb
ID: 39849656
I only program to have a Proof of Concept (prototype). Once the results (what is seen by my  potentials customers ) are good, I will give my code to a professional programmer to put it right!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Lately there has been a variety of news related to U.S. employment.  Stories about worker productivity, automobile and airline unions, low employment and foreign laborers have frequented the news.  Each story has good and bad attributes we might arg…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now