473,795 Members | 3,441 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can I force a new outlook mailitem to open in the Outlook HTML editor but not the Word editor?

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 HTML and the message looks
like crap. How can I force the message to open in the Outlook HTML editor?

Thanks,
Scott

Dim myOlApp As Object
Const olMailItem As Integer = 0
Dim ns As Object
Dim folder As Object
Dim myItem As Object
myOlApp = CreateObject("O utlook.Applicat ion")
myItem = myOlApp.CreateI tem(0)
With ne
HTML = [String].Format(strHTML , _
.NameFirst.Text , _
.nameLast.Text, _
.address1.Text, _
.Address2.Text, _
.City.Text, _
.state.Text, _
.Zip.Text, _
.phoneEve.Text, _
.phoneDay.Text, _
.Email.Text, _
.ddItems.Text, _
.old_refid.Text , _
strComments, _
.datecode.Text, _
.doc.Text, _
.ddCallType.Sel ectedItem.text, _
.ddResolution.S electedItem.tex t, _
.ddDisposition. SelectedItem.te xt, _
.txtOrderId.Tex t, _
.dop.Text, Comments.Text)
End With
myItem.HTMLBody = HTML
myItem.BodyForm at = 2
myItem.To = Me._To.Text
myItem.Subject = "Applica Contact Manager Record"
myItem.Display( )

--
Scott Emick
Web Programmer
Fox International
Remove the ham from mail address if it's not spam
Nov 21 '05 #1
1 2334
Scott,

For me this sounds if you will create the next to resolve bug. The user has
set his settings to use Word as mailagent and will with your program maybe
call Microsoft why that is not working?

In my opinion is the programmer of an application not the one who decide
what maileditor the user has to use, that he decide himself of company rules
say that it only has to be Outlook and than you have no problem.

I think that you only can give him an advice to use Outlook.

(What I don't understand as well is why a user has to see a message in a
message format what he cannot change, because he is not used to the tool you
give him)

However just my thought,

Cor
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 HTML and the
message looks like crap. How can I force the message to open in the
Outlook HTML editor?

Thanks,
Scott

Dim myOlApp As Object
Const olMailItem As Integer = 0
Dim ns As Object
Dim folder As Object
Dim myItem As Object
myOlApp = CreateObject("O utlook.Applicat ion")
myItem = myOlApp.CreateI tem(0)
With ne
HTML = [String].Format(strHTML , _
.NameFirst.Text , _
.nameLast.Text, _
.address1.Text, _
.Address2.Text, _
.City.Text, _
.state.Text, _
.Zip.Text, _
.phoneEve.Text, _
.phoneDay.Text, _
.Email.Text, _
.ddItems.Text, _
.old_refid.Text , _
strComments, _
.datecode.Text, _
.doc.Text, _
.ddCallType.Sel ectedItem.text, _
.ddResolution.S electedItem.tex t, _
.ddDisposition. SelectedItem.te xt, _
.txtOrderId.Tex t, _
.dop.Text, Comments.Text)
End With
myItem.HTMLBody = HTML
myItem.BodyForm at = 2
myItem.To = Me._To.Text
myItem.Subject = "Applica Contact Manager Record"
myItem.Display( )

--
Scott Emick
Web Programmer
Fox International
Remove the ham from mail address if it's not spam

Nov 21 '05 #2

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

Similar topics

2
768
by: MaxH | last post by:
I need to perform programmatically from a C# .net application the following tasks: _ open an outlook (or default e-mail client) compose message window; _ attach a document to the new message; _ set message attributes How can I do it? Thank you.
2
2196
by: Lauren Quantrell | last post by:
Using Outlook Automation, is there a way to insert a graphic in the body of an e-mail so that it appears at the top of an email? lq
9
7385
by: John | last post by:
Hi I am using the following code to search for an email message with id myID; Dim SentFld As Outlook.MAPIFolder Dim Email As Outlook.MailItem Dim I As Integer OutlookApp = New Outlook.Application SentFld =
10
2857
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 using the office2000 interop dlls generated by vs.net by adding office 2000 com reference. Any one else noticed this problem when targeting office2000/xp mixed environments? Is there a better, more robust way to do this? Am I better off using late...
2
2238
by: John | last post by:
Hi I am trying to find the way to create an email in outlook. I am using the code given at the end. It works fine the first time but calling the code second time gives the following error; Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.InvalidComObjectException: COM object that has been separated from its underlying RCW can...
8
2698
by: Li Pang | last post by:
Hi, I used following codes to pass a message item from CDO to Outlook. They worked fine when I used outlook 2000, but get an error of "Specified cast is not valid." when I used Outlook 2003. Anybody has an ideal? Dim outlookMsg AsMicrosoft.Office.Interop.Outlook.MailItem Dim adoMsg As MAPI.Message outlookMsg = Microsoft.Office.Interop.Outlook.Application.Session.GetItemFromID(cdoMsg.ID)
2
2451
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 has some problems: - doing a Move changes the ReceivedTime of the MailItem - I can't use RichText in the MailItem.Body (only allows plain text or HTML) - some other stuff like having to use small 'tricks' to show the default signature in an email
3
10651
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 mostly what I want. My issue is I would like to retain the signature block that exists when I insert my body into the message. Any help would be appreciated. Here is the code I am using: //Initialize the envelope values. string strTo =...
7
6811
by: Dean Spencer | last post by:
Can anyone help? I am importing Emails from Outlook using the following code: Public Function ScanInbox(SubjectLine As String) Dim TempRst As Recordset Dim OlApp As Outlook.Application Dim Inbox As Outlook.MAPIFolder Dim InboxItems As Outlook.Items Dim Mailobject As Object Set OlApp = CreateObject("Outlook.Application")
0
9672
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10214
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9042
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.