A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Body mail from MsWord



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 6th 06, 03:11 PM posted to microsoft.public.outlook.program_vba
Marcelo
external usenet poster
 
Posts: 1
Default Body mail from MsWord

Thanks everybody por the answers!

I solved my problem using
..HTMLFormat
..text = file

that "file" is the code read from the .doc file saved as html file.


"Michael Bauer" escreveu:

Am Wed, 28 Dec 2005 04:24:02 -0800 schrieb Marcelo:

Somehow I failed to notice what your real question is...

The Body property is for plain text only. I.e. there´re no formattings
possible. Use the HTMLBody property instead for html formatted text.

You could save the Document as an HTML file and then read its content (e.g.
with the Scripting.FileSystemObject).

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook



It's a great idea, but I'm still with a doubt.

I have already the text copyed from doc Word, but when I paste it in the
mail body, I lost the format.
I'm Using:

objMail.Body = oWord.Selection.FormattedText

Why isn't it working?



"Michael Bauer" escreveu:

Am Tue, 27 Dec 2005 17:54:02 -0800 schrieb Marcelo:

Marcelo, you can use Word´s object model to access any document. In

Outlook
add a reference to Word via Tools/References. Now you can easily explore
Word´s object model with the object browser (F2).

Reference on an opened Document: Application.Documents.Item(index)
Open a new Document: Application.Documents.Open(...)

All the Documents text is Document.Range.Text

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook


Hi, I would like some help with creating an e-mail with macro. I have a
macro
to create an e-mail, and I want that the body of the e-mail come from a
..doc
file.
Any help?

By the way, here it is the simple following macro to do this:


Sub CreateMail()
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
With objMail
.Display
.Subject = "Test"
.Importance = olImportanceHigh
.ReadReceiptRequested = True
.Sensitivity = olNormal
.Attachments.Add ("C:\Documents and Settings\Desktop\Test.txt")
.To = "
.Body = "Can I use MsWord?"
.Save
End With
End Sub



An easy question: how do I do to close the objMail?
objMail.Close is not working

Thanks on advance,
Marcelo


Ads
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I change the body of an appointment Raphael Outlook - Calandaring 1 February 16th 06 06:36 PM
Blank Body on emails Jim McColl Outlook Express 3 February 3rd 06 08:51 PM
HTML in mail body - no display with Word option checked Sue Mosher [MVP-Outlook] Outlook and VBA 0 February 1st 06 04:14 PM
how to change the mail message body Ram Add-ins for Outlook 10 January 27th 06 05:21 PM
How can I increase the mail body length when using mailto? maxrael Outlook and VBA 3 January 13th 06 10:17 PM


All times are GMT +1. The time now is 05:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.