![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |