Begginer question about sending mail from "Word" and "Outlook"

×

×בי

Hi

I'm creating an addin button that when I'll click on it, will send a mail to
certain recipients that I choose.

I want to do it from outlook 2003 and word 2003.

I retrieved the emails and I wrote.
I have a couple of questions:
1) When I send my mail from "Word". How can I cthat the body of the message
is the "Word" text document?

MailItem myMail = (MailItem)OutLookApp.CreateItem(OlItemType.olMailItem);

myMail.Body = .....
How can I specify that the Body is the "Word" document body?

2) I want to send mails but on a certain date in the future, and place them
in the outbox. Is there a way to do it?

3) If the text editor of the outlook is not "Word" and I want to define it
as "Word" for the current send, how can I do it - if it's possibble.


thanks in advance
 
K

Ken Slovak - [MVP - Outlook]

You cannot make the editor for that email message WordMail. You can change
body formats among the available formats (html, rich text and plain text)
but that's it. You can get the Word document contents as a string value and
set myMail.Body or .HTMLBody to the string value. For formatted text you'd
probably be best off setting myMail.BodyFormat to OlBodyFormat.olFormatHTML.
 
×

×בי

thanks you for your answer Ken.
However, for some reason I can't cerate a button just on the Word 2003
application.
I have used the code that is written here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;302901
But only in the Word application there was no button that was created and
even no MessageBox appeared after the OnStartupComplete and OnBeginShutdown
methods.
I have tried everything.
Any idea?
 
K

Ken Slovak - [MVP - Outlook]

That code will add a button to an Explorer (folder view), not an Inspector
(open item view). When you add a button to an Inspector using WordMail the
button will also show up in Word documents unless you use code to turn on
your UI when the Word.WindowActivate event fires and the window has
Window.Envelope.Visible == true. If it's false then you have to turn off
your UI to avoid showing the UI in Word documents.

I've posted code on how to do that.
 
×

×בי

Well, to tell you the truth, I don't have a lot of experience with Addin so I
didn't understand all of your answer.
You said that you posted a code. Where is it?
I looked at the site: http://www.slovaktech.com
but couldn't find it.
 
K

Ken Slovak - [MVP - Outlook]

The code has been posted a few times in various newsgroups, it should show
up in a google search on something like "WordMail".

For general information on Outlook programming and Outlook COM addins see
www.outlookcode.com, where there are lots of COM addin code samples,
including ones in C# and VSTO.
 
×

×בי

Ok
Thank you very much
--
Go OT


Ken Slovak - said:
The code has been posted a few times in various newsgroups, it should show
up in a google search on something like "WordMail".

For general information on Outlook programming and Outlook COM addins see
www.outlookcode.com, where there are lots of COM addin code samples,
including ones in C# and VSTO.
 

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