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

Format Body in Email



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 16th 08, 05:58 PM posted to microsoft.public.outlook.program_vba
Matt
external usenet poster
 
Posts: 119
Default Format Body in Email

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 = "
.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
__________________________________________________ _____



  #2  
Old July 16th 08, 07:17 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Format Body in Email

Try using the technique demonstrated at
http://www.outlookcode.com/codedetail.aspx?id=1333 instead.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"matt" wrote:

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 = "
.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
__________________________________________________ _____



  #3  
Old July 17th 08, 12:36 AM posted to microsoft.public.outlook.program_vba
Matt
external usenet poster
 
Posts: 119
Default Format Body in Email

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.

"Sue Mosher [MVP-Outlook]" wrote:

Try using the technique demonstrated at
http://www.outlookcode.com/codedetail.aspx?id=1333 instead.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"matt" wrote:

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 = "
.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
__________________________________________________ _____



  #4  
Old July 17th 08, 01:54 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Format Body in Email

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
http://www.outlookcode.com/jumpstart.aspx



"matt" wrote:

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.

"Sue Mosher [MVP-Outlook]" wrote:

Try using the technique demonstrated at
http://www.outlookcode.com/codedetail.aspx?id=1333 instead.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"matt" wrote:

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 = "
.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


  #5  
Old July 17th 08, 03:42 AM posted to microsoft.public.outlook.program_vba
Matt
external usenet poster
 
Posts: 119
Default Format Body in Email

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!

"Sue Mosher [MVP-Outlook]" wrote:

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
http://www.outlookcode.com/jumpstart.aspx



"matt" wrote:

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.

"Sue Mosher [MVP-Outlook]" wrote:

Try using the technique demonstrated at
http://www.outlookcode.com/codedetail.aspx?id=1333 instead.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"matt" wrote:

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 = "
.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


  #6  
Old July 17th 08, 04:27 AM posted to microsoft.public.outlook.program_vba
Matt
external usenet poster
 
Posts: 119
Default Format Body in Email

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!!!

"Sue Mosher [MVP-Outlook]" wrote:

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
http://www.outlookcode.com/jumpstart.aspx



"matt" wrote:

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.

"Sue Mosher [MVP-Outlook]" wrote:

Try using the technique demonstrated at
http://www.outlookcode.com/codedetail.aspx?id=1333 instead.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"matt" wrote:

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 = "
.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


  #7  
Old July 18th 08, 03:18 AM posted to microsoft.public.outlook.program_vba
Matt
external usenet poster
 
Posts: 119
Default Format Body in Email

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

"Sue Mosher [MVP-Outlook]" wrote:

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
http://www.outlookcode.com/jumpstart.aspx



"matt" wrote:

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.

"Sue Mosher [MVP-Outlook]" wrote:

Try using the technique demonstrated at
http://www.outlookcode.com/codedetail.aspx?id=1333 instead.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx



"matt" wrote:

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 = "
.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


 




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
Want to have Body of Task in HTML format Locksley Young Outlook - Calandaring 1 April 16th 08 06:13 AM
New Email Message in Outlook 2007 starts in Body of email not in To:field [email protected] Outlook - General Queries 3 March 28th 08 01:23 AM
Outlook 2003 Script: Pb body format news.microsoft.com Outlook and VBA 5 October 30th 06 07:05 PM
How to get the mail body format of the outlook 2000 Laxman Add-ins for Outlook 4 June 30th 06 05:05 PM
syntax problem 'body format' philippe Outlook - Using Forms 1 May 3rd 06 01:00 PM


All times are GMT +1. The time now is 12:22 PM.


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.