473,419 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

confused on outlook email editor issue in C#

VP
g'day,

i am posting a problem i have encountered with creating an email using
outlook through some basic c# code. the problem arises when using
different email editors in outlook. At the moment i am using outlook
2000. Outlook can be configured to use the default outlook email editor
or use ms word as the email editor in outlook.

The sample code below simply creates an email with a hyperlink. The
problem I am facing is that when outlook is configured to us ms word as
the email editor, the email created doesnt show the hyperlink. When the
email editor is switched over to the outlook email editor the
hyperlinks show up.

My question is that why does this happen ??? Is this fallacy on Outlook
side or am i misunderstanding something here??

If anyone can correct me I would really appreciate it.

thanks
Vee

private void CreateEmail()
{
string sHtml = "";
string signature = "";

Outlook.Application oApp;
Outlook._NameSpace oNameSpace;
Outlook.MAPIFolder oOutlookFolder;
oApp = new Outlook.Application();
oNameSpace= oApp.GetNamespace("MAPI");
oNameSpace.Logon(null,null,false,true);
oOutlookFolder =
oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolde rs.olFolderSentMail);
Outlook._MailItem oMailItem =
(Outlook._MailItem)oApp.CreateItem(Outlook.OlItemT ype.olMailItem);

//display the blank email first so that the signature can be retained
oMailItem.Display(false);

//extract the signature from the HTMLBODY
signature = oMailItem.HTMLBody;

//create a hyperlink
sHtml += "<a href=
"+"\""+"http://www.google.com"+"\">"+"google"+"</a>\n"+"<br>\n";

//clear the email body
oMailItem.Body="";
//append the hyperlink to the email body
oMailItem.Body+=sHtml;
//append the email body and signature to the html body of the email
oMailItem.HTMLBody=oMailItem.Body+signature;
}

Nov 17 '05 #1
0 2119

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fritz Switzer | last post by:
Can anyone provide a small snippet in C# that pulls out the Contacts in Outlook XP. I've seen a couple of examples in C++ and VB in previous newsgroup posts, but either the originals didn't work...
1
by: KS | last post by:
Hi, I have creatd a custom Outlook form with a few custom form fields. When completed the form is sent to me and goes into my Inbox. This works fine. Now Iam trying to write some code in...
2
by: Susan Bricker | last post by:
I have a routine that uses Late Binding to create a email and put it into the DRAFTS folder of Outlook. It only works if Outlook is already launched (Opened by me clicking on my desktop ICON...
1
by: John Smith | last post by:
Hi, I'm trying to send email in our C# ASP.Net application using the Outlook 11 library. For a bunch of unimportant reasons (unimportant to this posting that is) we have to do it this way and...
10
by: John | last post by:
Hi When I open a new outlook email from vb.net, sometimes outlook is very slow to appear or occasionally outlook freezes completely. I am targeting mixed office2000/xp environments so I am...
1
by: Scott Emick | last post by:
I am using the following code. When outlook opens the message and the Outlook HTML editor is the default editor, there is no problem. If Word is the default editor, however, it butchers up the...
2
by: Pieter | last post by:
Hi, I'm using a thight integration with Outlook 2003 (with an Exchange server) in my VB.NET (2005) application. Until now I'm using the Outlook Object Model, but it appears to be very slow, and...
3
by: Jeff | last post by:
I am trying to send emails from my application (not using a plugin, that will come later), I can create an email and add attachments. I can fill in the body etc. Word works for the editor. So...
8
by: mc | last post by:
I would like to be able to send from an ASP.NET page an email which when recieved takes the form of a "Sharing Invitation for a RSS Feed"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.