Format Body in Email

M

matt

Hello all,
So I have a macro in Word 2003 that takes the ActiveDocument and copy/pastes
it into the body of an email message in Outlook 2007. 90% of the things in
the document are things that are linked to Excel. Everything shows up fine
except for 3 graphs that are located at the bottom of the document.
When I view these charts in the body of the email the charts are blown-up to
almost 3x's their origional size in the Word doc. Can't figure out why this
would happen? I have tried going to Options/Mail Format and unchecking the
checkbox that says something like "Remove all formatting that is not
necessary to display the message", or something along those lines. But it
did'nt change a thing.
Here is the code I am using:
____________________________________________________
Private Sub SendAsBody_Click()

Dim bStarted As Boolean
Dim oOutlookApp As outlook.Application
Dim oItem As outlook.MailItem

On Error Resume Next

'Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")

'Outlook wasn't running, start it from code
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If

'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olmailitem)
With oItem
.To = "(e-mail address removed)"
.Subject = InputBox("Fill-in the subject for this email:", , _
" Daily Operational Report")
ActiveDocument.Range.FormattedText.Copy
.GetInspector.WordEditor.Range.Paste
.Display
End With

'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing

End Sub
_______________________________________________________
 
M

matt

Is that written in Outlook VB? The one I have is written through Word,
because of my security setting at work do not allow me to write macros in
Outlook.
Is there some setting in Outlook that I can do that will fix the formatting
issue for the graphs being bloated.
 
S

Sue Mosher [MVP-Outlook]

The sample is written for Outlook VBA, but could be easily adapted to run
from Word VBA using the technique you already know for instantiating an
Outlook.Application object.

Outlook has no settings related to displaying graphs.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
M

matt

Ok. Many thanks. I went to Tools/Options-->Mail Format-->Editor Options-->
and then Advanced. In there it has a section for "Cut, Copy, and Paste",
would that be something I should play with? Because the code copys the
ActiveDocument and then pastes it into a email message. But, I will try to
convert that sample code you gave me. Thanks again!
 
M

matt

I just tested the code on my personal email on my Outlook at home, and it
worked!! But I'm going to have to test it when I get to work tomorrow. But I
think it will be ok. Thanks again!!!
 
M

matt

Sue,
What is the difference in the code I posted and your code, besides where it
is written. Because all the formatting is kept when I use your code in Oulook
but not when I use it in Word. I can't use the Outlook VBA at work thats the
reason for using it in Word.
Thanks,
Matt
 

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