Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Outlook OLE Automation - Formatting Text


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Mar 4, 2018 1:22 AM Last Post By: Barry Wood
Barry Wood

Posts: 73
Registered: 9/3/01
Outlook OLE Automation - Formatting Text  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 9, 2018 5:12 AM
Hi,

I have a working application which creates and sends emails using Outlook, and this works fine.

However, I'd like to be able to format the body text but can't find out how to do that. Is there somewhere that lists all the parameters that can be used:

I've seen somewhere that I should use 'ContentType:= 'multipart/relative' but I get a 'Invalid variant operation' when it runs, so guess either that is incorrect or some other setting should be created first.

Any help would be appreciated.
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Outlook OLE Automation - Formatting Text  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 9, 2018 11:51 PM   in response to: Barry Wood in response to: Barry Wood
Barry Wood wrote:
Hi,

I have a working application which creates and sends emails using Outlook

Can you show some code to see how you use the Outlook Automation?
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Outlook OLE Automation - Formatting Text  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 10, 2018 5:32 AM   in response to: Barry Wood in response to: Barry Wood
If you use Outlook MailItem.

//instead of:
MailItem1.Body:='This is my text';
 
//Use HTML to format your text:
MailItem1.HTMLBody:='This is my <b>Bold</b> text';
Barry Wood

Posts: 73
Registered: 9/3/01
Re: Outlook OLE Automation - Formatting Text  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 4, 2018 1:22 AM   in response to: Robert Triest in response to: Robert Triest
This fixes it - use of HTMLBody - gives me exactly what I'm after. Many thanks.

Robert Triest wrote:
If you use Outlook MailItem.

//instead of:
MailItem1.Body:='This is my text';
 
//Use HTML to format your text:
MailItem1.HTMLBody:='This is my <b>Bold</b> text';
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02