Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in
the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an email opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
|
#3
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
It was never necessary to copy and paste into a blank email in Outlook. All
you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#4
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
But I don't want to send the entire Word document -- just the portion of it
that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#5
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
"George Lutz" wrote in message
... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! Unfortunately Outlook 2007 doesn't use all of Word 2007 as the email editor - it uses a stub. Therefore you can't do what you used to do in 2003 in the same way. However, I don't understand why you would compose an email in Word and then paste the text into an email - why not just write the text directly into a new email message? |
#6
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
Because in my Word document, I use macros that greatly simplify my composing
of the email. E.g., if I want to send an email to Jennifer, my ETJ macro prepares the header, including To: Jennifer, From: George, it inputs the client name into a line, etc. Then I sue another macro to select and copy the whole email, hit the button that apparently no longer exists in 2007, then hit Control-V to insert everything into the blank email template. "Gordon" wrote: "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! Unfortunately Outlook 2007 doesn't use all of Word 2007 as the email editor - it uses a stub. Therefore you can't do what you used to do in 2003 in the same way. However, I don't understand why you would compose an email in Word and then paste the text into an email - why not just write the text directly into a new email message? |
#7
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
"George Lutz" wrote in message
... Because in my Word document, I use macros that greatly simplify my composing of the email. E.g., if I want to send an email to Jennifer, my ETJ macro prepares the header, including To: Jennifer, From: George, it inputs the client name into a line, etc. Then I sue another macro to select and copy the whole email, hit the button that apparently no longer exists in 2007, then hit Control-V to insert everything into the blank email template. Have you looked into the use of Forms in Outlook 2007? |
#8
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
I suspect what you are looking for is the 'Send To Mail Recipient' command
which you can add to the QAT. or You can select the text you want in your e-mail and run the following macro Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub http://www.gmayor.com/installing_macro.htm If you want to pick the recipient delete the .to line -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Because in my Word document, I use macros that greatly simplify my composing of the email. E.g., if I want to send an email to Jennifer, my ETJ macro prepares the header, including To: Jennifer, From: George, it inputs the client name into a line, etc. Then I sue another macro to select and copy the whole email, hit the button that apparently no longer exists in 2007, then hit Control-V to insert everything into the blank email template. "Gordon" wrote: "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! Unfortunately Outlook 2007 doesn't use all of Word 2007 as the email editor - it uses a stub. Therefore you can't do what you used to do in 2003 in the same way. However, I don't understand why you would compose an email in Word and then paste the text into an email - why not just write the text directly into a new email message? |
#9
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
Hi Graham
In Word 2007 I select text and run macro but I get a compile error on below line: Dim oOutlookApp As Outlook.Application User define type not defined. How can I resolve this please? "Graham Mayor" wrote in message ... I suspect what you are looking for is the 'Send To Mail Recipient' command which you can add to the QAT. or You can select the text you want in your e-mail and run the following macro Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub http://www.gmayor.com/installing_macro.htm If you want to pick the recipient delete the .to line -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Because in my Word document, I use macros that greatly simplify my composing of the email. E.g., if I want to send an email to Jennifer, my ETJ macro prepares the header, including To: Jennifer, From: George, it inputs the client name into a line, etc. Then I sue another macro to select and copy the whole email, hit the button that apparently no longer exists in 2007, then hit Control-V to insert everything into the blank email template. "Gordon" wrote: "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! Unfortunately Outlook 2007 doesn't use all of Word 2007 as the email editor - it uses a stub. Therefore you can't do what you used to do in 2003 in the same way. However, I don't understand why you would compose an email in Word and then paste the text into an email - why not just write the text directly into a new email message? |
#10
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
From the vba editor tools references check the Microsoft Outlook 12
Object Library -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: Hi Graham In Word 2007 I select text and run macro but I get a compile error on below line: Dim oOutlookApp As Outlook.Application User define type not defined. How can I resolve this please? "Graham Mayor" wrote in message ... I suspect what you are looking for is the 'Send To Mail Recipient' command which you can add to the QAT. or You can select the text you want in your e-mail and run the following macro Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub http://www.gmayor.com/installing_macro.htm If you want to pick the recipient delete the .to line -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Because in my Word document, I use macros that greatly simplify my composing of the email. E.g., if I want to send an email to Jennifer, my ETJ macro prepares the header, including To: Jennifer, From: George, it inputs the client name into a line, etc. Then I sue another macro to select and copy the whole email, hit the button that apparently no longer exists in 2007, then hit Control-V to insert everything into the blank email template. "Gordon" wrote: "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! Unfortunately Outlook 2007 doesn't use all of Word 2007 as the email editor - it uses a stub. Therefore you can't do what you used to do in 2003 in the same way. However, I don't understand why you would compose an email in Word and then paste the text into an email - why not just write the text directly into a new email message? |
#11
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
Yes it just occurred to me THANKS.
"Graham Mayor" wrote in message ... From the vba editor tools references check the Microsoft Outlook 12 Object Library -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: Hi Graham In Word 2007 I select text and run macro but I get a compile error on below line: Dim oOutlookApp As Outlook.Application User define type not defined. How can I resolve this please? "Graham Mayor" wrote in message ... I suspect what you are looking for is the 'Send To Mail Recipient' command which you can add to the QAT. or You can select the text you want in your e-mail and run the following macro Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub http://www.gmayor.com/installing_macro.htm If you want to pick the recipient delete the .to line -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Because in my Word document, I use macros that greatly simplify my composing of the email. E.g., if I want to send an email to Jennifer, my ETJ macro prepares the header, including To: Jennifer, From: George, it inputs the client name into a line, etc. Then I sue another macro to select and copy the whole email, hit the button that apparently no longer exists in 2007, then hit Control-V to insert everything into the blank email template. "Gordon" wrote: "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! Unfortunately Outlook 2007 doesn't use all of Word 2007 as the email editor - it uses a stub. Therefore you can't do what you used to do in 2003 in the same way. However, I don't understand why you would compose an email in Word and then paste the text into an email - why not just write the text directly into a new email message? |
#12
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
George
You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#13
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
Graham's macro works very nicely -- thank you, Graham.
Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#14
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
Right-click anywhere on the QAT and select Customize. In the customize
dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#15
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
Terry -- thanks, I found it.
Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#16
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
In Outlook, go to Tools, Options, select the Mail Format tab and then click
on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#17
Posted to microsoft.public.word.newusers
|
|||
|
|||
How to get to email from Word
Terry:
Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#18
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
I can't think of a way to pass the formatting between the applications
using this macro construction. Until someone comes up with something better, change the line. ..Body = Selection to ..Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#19
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
Try
..Body = Selection.FormattedText -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#20
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
I had already tried that
The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org .. Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#21
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
Exactly. You can do CTRL V and it works but not with VBA?
"Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#22
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
There ought to be a way to use HTMLBody but it isn't entirely
straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste -- Enjoy, Tony "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#23
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
Kudos to you Tony Brilliant....
"Tony Jollans" My forename at my surname dot com wrote in message ... There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste -- Enjoy, Tony "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#24
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
Brilliant - thanks
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#25
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
That'll teach me to not to be so fast in pressing the send button
There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#26
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#27
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
Hmmm! That's essentially what Tony suggested, but it doesn't work for me
with either Word 2003 or 2007. Nothing is pasted into the text space, unless you actually click the paste button or CTRL+V -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#28
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
Graham,
I know you do other things in Outlook - do you have active event procedures that might interfere at all? Is it just the paste that fails - can you do anything with the Document (WordEditor) object, or its Range object? I'm not sure what else to ask - do you get the OMG prompt (triggered by the GetInspector)? Does it make a difference if Outlook is already running? -- Enjoy, Tony "Graham Mayor" wrote in message ... Hmmm! That's essentially what Tony suggested, but it doesn't work for me with either Word 2003 or 2007. Nothing is pasted into the text space, unless you actually click the paste button or CTRL+V -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#29
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
I don't get any prompt, I do have Express Click Yes installed (if that is
the OMG prompt). "Jen" wrote in message ... I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#30
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
I don't have it installed so can't confirm but ClickYes should catch it, I
believe, yes. -- Enjoy, Tony "Jen" wrote in message ... I don't get any prompt, I do have Express Click Yes installed (if that is the OMG prompt). "Jen" wrote in message ... I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#31
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
The only thing I do in Outlook is extract a line of code from a daily e-mail
and paste it into a Word table, using a variation of the code we discussed on an earlier occasion. I don't appear to be able to do anything in code with the object. I don't get an OMG (?) prompt or any other prompt or error message. The Outlook message window opens the addressee and subject are filled and (if nothing is entered in the ".Body =" line) the default theme is used. The cursor is in the body area and nothing is pasted. Pressing CTRL V or clicking the Paste button pastes the formatted text. I don't know if it is a clue, but if I enter ..GetInspector and then a period vba prompts with the options - including ..WordEditor If I add a period to the end of that, there isn't the usual prompt offering ..Range etc (though it doesn't baulk at its addition). It doesn't make any difference whether or not Outlook is running. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tony Jollans wrote: Graham, I know you do other things in Outlook - do you have active event procedures that might interfere at all? Is it just the paste that fails - can you do anything with the Document (WordEditor) object, or its Range object? I'm not sure what else to ask - do you get the OMG prompt (triggered by the GetInspector)? Does it make a difference if Outlook is already running? "Graham Mayor" wrote in message ... Hmmm! That's essentially what Tony suggested, but it doesn't work for me with either Word 2003 or 2007. Nothing is pasted into the text space, unless you actually click the paste button or CTRL+V -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#32
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
I don't know if it is a clue, but if I enter
.GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). That is normal. The intellisense doesn't recognise "WordEditor" as returning a Document object - nor, for that matter, do people until they are told. Interesting that you don't get the OMG (Object Model Guard) prompt. Unless you are running ClickYes or some equivalent, the implication (I think, and to some extent confirmed by the fact that you can't do anything with the object) is that you are not connecting to Outlook properly. I'm sorry but I don't have a clue why that might be. -- Enjoy, Tony "Graham Mayor" wrote in message ... The only thing I do in Outlook is extract a line of code from a daily e-mail and paste it into a Word table, using a variation of the code we discussed on an earlier occasion. I don't appear to be able to do anything in code with the object. I don't get an OMG (?) prompt or any other prompt or error message. The Outlook message window opens the addressee and subject are filled and (if nothing is entered in the ".Body =" line) the default theme is used. The cursor is in the body area and nothing is pasted. Pressing CTRL V or clicking the Paste button pastes the formatted text. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). It doesn't make any difference whether or not Outlook is running. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tony Jollans wrote: Graham, I know you do other things in Outlook - do you have active event procedures that might interfere at all? Is it just the paste that fails - can you do anything with the Document (WordEditor) object, or its Range object? I'm not sure what else to ask - do you get the OMG prompt (triggered by the GetInspector)? Does it make a difference if Outlook is already running? "Graham Mayor" wrote in message ... Hmmm! That's essentially what Tony suggested, but it doesn't work for me with either Word 2003 or 2007. Nothing is pasted into the text space, unless you actually click the paste button or CTRL+V -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#33
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
I am not running ClickYes or anything else I can think of that may interfere
and otherwise I do have a normal interface between Outlook and Word and vice versa. When I have time to waste I'll repair Office and see if that improves things. In the meantime, it is no big deal for me as the issue arose out of a third party query and at least the third party seems to have it working -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tony Jollans wrote: I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). That is normal. The intellisense doesn't recognise "WordEditor" as returning a Document object - nor, for that matter, do people until they are told. Interesting that you don't get the OMG (Object Model Guard) prompt. Unless you are running ClickYes or some equivalent, the implication (I think, and to some extent confirmed by the fact that you can't do anything with the object) is that you are not connecting to Outlook properly. I'm sorry but I don't have a clue why that might be. "Graham Mayor" wrote in message ... The only thing I do in Outlook is extract a line of code from a daily e-mail and paste it into a Word table, using a variation of the code we discussed on an earlier occasion. I don't appear to be able to do anything in code with the object. I don't get an OMG (?) prompt or any other prompt or error message. The Outlook message window opens the addressee and subject are filled and (if nothing is entered in the ".Body =" line) the default theme is used. The cursor is in the body area and nothing is pasted. Pressing CTRL V or clicking the Paste button pastes the formatted text. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). It doesn't make any difference whether or not Outlook is running. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tony Jollans wrote: Graham, I know you do other things in Outlook - do you have active event procedures that might interfere at all? Is it just the paste that fails - can you do anything with the Document (WordEditor) object, or its Range object? I'm not sure what else to ask - do you get the OMG prompt (triggered by the GetInspector)? Does it make a difference if Outlook is already running? "Graham Mayor" wrote in message ... Hmmm! That's essentially what Tony suggested, but it doesn't work for me with either Word 2003 or 2007. Nothing is pasted into the text space, unless you actually click the paste button or CTRL+V -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#34
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
You might find the recent discussion at http://www.outlookcode.com/threads.a...essageid=26382 useful, as it was on a similar subject.
I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). Declare a Word.Document object and instantiate it: Dim objDoc as Word.Document Dim objDoc = MyMessage.GetInspector.WordEditor You'll then get intellisense for objDoc. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Graham Mayor" wrote in message ... The only thing I do in Outlook is extract a line of code from a daily e-mail and paste it into a Word table, using a variation of the code we discussed on an earlier occasion. I don't appear to be able to do anything in code with the object. I don't get an OMG (?) prompt or any other prompt or error message. The Outlook message window opens the addressee and subject are filled and (if nothing is entered in the ".Body =" line) the default theme is used. The cursor is in the body area and nothing is pasted. Pressing CTRL V or clicking the Paste button pastes the formatted text. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). It doesn't make any difference whether or not Outlook is running. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tony Jollans wrote: Graham, I know you do other things in Outlook - do you have active event procedures that might interfere at all? Is it just the paste that fails - can you do anything with the Document (WordEditor) object, or its Range object? I'm not sure what else to ask - do you get the OMG prompt (triggered by the GetInspector)? Does it make a difference if Outlook is already running? "Graham Mayor" wrote in message ... Hmmm! That's essentially what Tony suggested, but it doesn't work for me with either Word 2003 or 2007. Nothing is pasted into the text space, unless you actually click the paste button or CTRL+V -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#35
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
Thanks for that. I assume the second 'Dim' was a typo?
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Sue Mosher [MVP-Outlook] wrote: You might find the recent discussion at http://www.outlookcode.com/threads.a...essageid=26382 useful, as it was on a similar subject. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). Declare a Word.Document object and instantiate it: Dim objDoc as Word.Document Dim objDoc = MyMessage.GetInspector.WordEditor You'll then get intellisense for objDoc. "Graham Mayor" wrote in message ... The only thing I do in Outlook is extract a line of code from a daily e-mail and paste it into a Word table, using a variation of the code we discussed on an earlier occasion. I don't appear to be able to do anything in code with the object. I don't get an OMG (?) prompt or any other prompt or error message. The Outlook message window opens the addressee and subject are filled and (if nothing is entered in the ".Body =" line) the default theme is used. The cursor is in the body area and nothing is pasted. Pressing CTRL V or clicking the Paste button pastes the formatted text. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). It doesn't make any difference whether or not Outlook is running. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tony Jollans wrote: Graham, I know you do other things in Outlook - do you have active event procedures that might interfere at all? Is it just the paste that fails - can you do anything with the Document (WordEditor) object, or its Range object? I'm not sure what else to ask - do you get the OMG prompt (triggered by the GetInspector)? Does it make a difference if Outlook is already running? "Graham Mayor" wrote in message ... Hmmm! That's essentially what Tony suggested, but it doesn't work for me with either Word 2003 or 2007. Nothing is pasted into the text space, unless you actually click the paste button or CTRL+V -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#36
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
Yes, it should have been Set not Dim. Sorry for the confusion.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Graham Mayor" wrote in message ... Thanks for that. I assume the second 'Dim' was a typo? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Sue Mosher [MVP-Outlook] wrote: You might find the recent discussion at http://www.outlookcode.com/threads.a...essageid=26382 useful, as it was on a similar subject. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). Declare a Word.Document object and instantiate it: Dim objDoc as Word.Document Dim objDoc = MyMessage.GetInspector.WordEditor You'll then get intellisense for objDoc. "Graham Mayor" wrote in message ... The only thing I do in Outlook is extract a line of code from a daily e-mail and paste it into a Word table, using a variation of the code we discussed on an earlier occasion. I don't appear to be able to do anything in code with the object. I don't get an OMG (?) prompt or any other prompt or error message. The Outlook message window opens the addressee and subject are filled and (if nothing is entered in the ".Body =" line) the default theme is used. The cursor is in the body area and nothing is pasted. Pressing CTRL V or clicking the Paste button pastes the formatted text. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). It doesn't make any difference whether or not Outlook is running. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tony Jollans wrote: Graham, I know you do other things in Outlook - do you have active event procedures that might interfere at all? Is it just the paste that fails - can you do anything with the Document (WordEditor) object, or its Range object? I'm not sure what else to ask - do you get the OMG prompt (triggered by the GetInspector)? Does it make a difference if Outlook is already running? "Graham Mayor" wrote in message ... Hmmm! That's essentially what Tony suggested, but it doesn't work for me with either Word 2003 or 2007. Nothing is pasted into the text space, unless you actually click the paste button or CTRL+V -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#37
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
Sue
The suggestion set the little cogs in motion The following now does work to paste the formatted text into the body of the message, and I have added a routine to grab the addressee information from Outlook. However while it does work when Outlook is running already, it usually crashes Word when Outlook is supposed to be started from the macro. Sub Send_Extract_As_EMail() ' send the document in an Outlook Email message ' 2007 Graham Mayor, Tony Jollans, Doug Robbins ' & Sue Mosher Dim bStarted As Boolean Dim oOutlookApp As Outlook.Application Dim oItem As Outlook.MailItem Dim objDoc As Word.Document Dim strEMail As String strEMail = "PR_EMAIL_ADDRESS" 'Let the user choose the contact from Outlook 'And assign the email address to a variable strEMail = Application.GetAddress("", strEMail, _ False, 1, , , True, True) If strEMail = "" Then MsgBox "User cancelled or no address listed", , "Cancel" End If 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) Set objDoc = oItem.GetInspector.WordEditor With oItem .to = strEMail .Subject = InputBox("Subject?") Selection.Copy objDoc.Range.Paste .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Sue Mosher [MVP-Outlook] wrote: Yes, it should have been Set not Dim. Sorry for the confusion. "Graham Mayor" wrote in message ... Thanks for that. I assume the second 'Dim' was a typo? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Sue Mosher [MVP-Outlook] wrote: You might find the recent discussion at http://www.outlookcode.com/threads.a...essageid=26382 useful, as it was on a similar subject. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). Declare a Word.Document object and instantiate it: Dim objDoc as Word.Document Dim objDoc = MyMessage.GetInspector.WordEditor You'll then get intellisense for objDoc. "Graham Mayor" wrote in message ... The only thing I do in Outlook is extract a line of code from a daily e-mail and paste it into a Word table, using a variation of the code we discussed on an earlier occasion. I don't appear to be able to do anything in code with the object. I don't get an OMG (?) prompt or any other prompt or error message. The Outlook message window opens the addressee and subject are filled and (if nothing is entered in the ".Body =" line) the default theme is used. The cursor is in the body area and nothing is pasted. Pressing CTRL V or clicking the Paste button pastes the formatted text. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). It doesn't make any difference whether or not Outlook is running. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tony Jollans wrote: Graham, I know you do other things in Outlook - do you have active event procedures that might interfere at all? Is it just the paste that fails - can you do anything with the Document (WordEditor) object, or its Range object? I'm not sure what else to ask - do you get the OMG prompt (triggered by the GetInspector)? Does it make a difference if Outlook is already running? "Graham Mayor" wrote in message ... Hmmm! That's essentially what Tony suggested, but it doesn't work for me with either Word 2003 or 2007. Nothing is pasted into the text space, unless you actually click the paste button or CTRL+V -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#38
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
Which statement causes the crash? Error messages?
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Graham Mayor" wrote in message ... Sue The suggestion set the little cogs in motion The following now does work to paste the formatted text into the body of the message, and I have added a routine to grab the addressee information from Outlook. However while it does work when Outlook is running already, it usually crashes Word when Outlook is supposed to be started from the macro. Sub Send_Extract_As_EMail() ' send the document in an Outlook Email message ' 2007 Graham Mayor, Tony Jollans, Doug Robbins ' & Sue Mosher Dim bStarted As Boolean Dim oOutlookApp As Outlook.Application Dim oItem As Outlook.MailItem Dim objDoc As Word.Document Dim strEMail As String strEMail = "PR_EMAIL_ADDRESS" 'Let the user choose the contact from Outlook 'And assign the email address to a variable strEMail = Application.GetAddress("", strEMail, _ False, 1, , , True, True) If strEMail = "" Then MsgBox "User cancelled or no address listed", , "Cancel" End If 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) Set objDoc = oItem.GetInspector.WordEditor With oItem .to = strEMail .Subject = InputBox("Subject?") Selection.Copy objDoc.Range.Paste .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Sue Mosher [MVP-Outlook] wrote: Yes, it should have been Set not Dim. Sorry for the confusion. "Graham Mayor" wrote in message ... Thanks for that. I assume the second 'Dim' was a typo? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Sue Mosher [MVP-Outlook] wrote: You might find the recent discussion at http://www.outlookcode.com/threads.a...essageid=26382 useful, as it was on a similar subject. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). Declare a Word.Document object and instantiate it: Dim objDoc as Word.Document Dim objDoc = MyMessage.GetInspector.WordEditor You'll then get intellisense for objDoc. "Graham Mayor" wrote in message ... The only thing I do in Outlook is extract a line of code from a daily e-mail and paste it into a Word table, using a variation of the code we discussed on an earlier occasion. I don't appear to be able to do anything in code with the object. I don't get an OMG (?) prompt or any other prompt or error message. The Outlook message window opens the addressee and subject are filled and (if nothing is entered in the ".Body =" line) the default theme is used. The cursor is in the body area and nothing is pasted. Pressing CTRL V or clicking the Paste button pastes the formatted text. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). It doesn't make any difference whether or not Outlook is running. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tony Jollans wrote: Graham, I know you do other things in Outlook - do you have active event procedures that might interfere at all? Is it just the paste that fails - can you do anything with the Document (WordEditor) object, or its Range object? I'm not sure what else to ask - do you get the OMG prompt (triggered by the GetInspector)? Does it make a difference if Outlook is already running? "Graham Mayor" wrote in message ... Hmmm! That's essentially what Tony suggested, but it doesn't work for me with either Word 2003 or 2007. Nothing is pasted into the text space, unless you actually click the paste button or CTRL+V -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#39
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
It just crashes without any vba error message - just the Word has
encountered an error and needs to close message, followed by the fault reporting screen. Word then restarts. The error occurs after the prompt for the Subject so presumably the fault lies at Selection.Copy objDoc.Range.Paste ..Display On the few occasions when it doesn't crash, the selected formatted text is not pasted into the message window. When Outlook is already running in the background, the macro works as intended in both Word 2003 and 2007 (both with Outlook 2007). -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Sue Mosher [MVP-Outlook] wrote: Which statement causes the crash? Error messages? "Graham Mayor" wrote in message ... Sue The suggestion set the little cogs in motion The following now does work to paste the formatted text into the body of the message, and I have added a routine to grab the addressee information from Outlook. However while it does work when Outlook is running already, it usually crashes Word when Outlook is supposed to be started from the macro. Sub Send_Extract_As_EMail() ' send the document in an Outlook Email message ' 2007 Graham Mayor, Tony Jollans, Doug Robbins ' & Sue Mosher Dim bStarted As Boolean Dim oOutlookApp As Outlook.Application Dim oItem As Outlook.MailItem Dim objDoc As Word.Document Dim strEMail As String strEMail = "PR_EMAIL_ADDRESS" 'Let the user choose the contact from Outlook 'And assign the email address to a variable strEMail = Application.GetAddress("", strEMail, _ False, 1, , , True, True) If strEMail = "" Then MsgBox "User cancelled or no address listed", , "Cancel" End If 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) Set objDoc = oItem.GetInspector.WordEditor With oItem .to = strEMail .Subject = InputBox("Subject?") Selection.Copy objDoc.Range.Paste .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Sue Mosher [MVP-Outlook] wrote: Yes, it should have been Set not Dim. Sorry for the confusion. "Graham Mayor" wrote in message ... Thanks for that. I assume the second 'Dim' was a typo? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Sue Mosher [MVP-Outlook] wrote: You might find the recent discussion at http://www.outlookcode.com/threads.a...essageid=26382 useful, as it was on a similar subject. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). Declare a Word.Document object and instantiate it: Dim objDoc as Word.Document Dim objDoc = MyMessage.GetInspector.WordEditor You'll then get intellisense for objDoc. "Graham Mayor" wrote in message ... The only thing I do in Outlook is extract a line of code from a daily e-mail and paste it into a Word table, using a variation of the code we discussed on an earlier occasion. I don't appear to be able to do anything in code with the object. I don't get an OMG (?) prompt or any other prompt or error message. The Outlook message window opens the addressee and subject are filled and (if nothing is entered in the ".Body =" line) the default theme is used. The cursor is in the body area and nothing is pasted. Pressing CTRL V or clicking the Paste button pastes the formatted text. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). It doesn't make any difference whether or not Outlook is running. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tony Jollans wrote: Graham, I know you do other things in Outlook - do you have active event procedures that might interfere at all? Is it just the paste that fails - can you do anything with the Document (WordEditor) object, or its Range object? I'm not sure what else to ask - do you get the OMG prompt (triggered by the GetInspector)? Does it make a difference if Outlook is already running? "Graham Mayor" wrote in message ... Hmmm! That's essentially what Tony suggested, but it doesn't work for me with either Word 2003 or 2007. Nothing is pasted into the text space, unless you actually click the paste button or CTRL+V -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Jen wrote: I use 2007 Outlook and Word 2003 and Word 2007 I did play with Options Mail Format to HTML and Rich Text. Sub Send_Extract_As_MailKeepFmt() ' send the document in an Outlook Email message - HTML Rich Text Format maintained (Brilliant) ' 20April2008 ' 2007 Graham Mayor Tony Jollans Doug Robbins 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("Subject?") Selection.Copy .GetInspector.WordEditor.Range.Paste ' .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub "Graham Mayor" wrote in message ... That'll teach me to not to be so fast in pressing the send button There appears to be something I am missing? The modifications do not paste the text into the message here? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: Brilliant - thanks Tony Jollans wrote: There ought to be a way to use HTMLBody but it isn't entirely straightforward. What you can do is address the Word editor in Outlook 2007 and paste the selection in. The downside to this is that the OMG gives you a popup but that probably isn't a big issue in a personal environment. Instead of: .Body = Selection Try: Selection.Copy .GetInspector.WordEditor.Range.Paste "Graham Mayor" wrote in message ... I had already tried that The formatting is lost between Word and Outlook and there doesn't seem to be a way to actually paste into the text area of the Outlook message window using the macro that I have found ... yet -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org . Doug Robbins - Word MVP wrote: Try .Body = Selection.FormattedText "Graham Mayor" wrote in message ... I can't think of a way to pass the formatting between the applications using this macro construction. Until someone comes up with something better, change the line. .Body = Selection to .Body = "" and paste your formatted selection into the text area. To cast the net wider I have cross-posted to the programming and Outlook forums Sub Send_Extract_As_Mail() ' send the document in an Outlook Email message 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("Subject?") .Body = Selection .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org George Lutz wrote: Terry: Thanks, but that had no effect on the result. George Lutz "Terry Farrell" wrote: In Outlook, go to Tools, Options, select the Mail Format tab and then click on Editor Options at the bottom. Select the Advanced tab and then under Cut, Copy Paste section, make sure that the Keep Source formatting option is selected. that should then paste and keep your formatting without need to modify the macro. Terry "George Lutz" wrote in message ... Terry -- thanks, I found it. Graham: Can your macro be modifed so that the text that is pasted into the email body preserves the formatting it had in Word? When I run your macro, bolded text becomes unbolded and tabs disappear. Thanks. George Lutz "Terry Farrell" wrote: Right-click anywhere on the QAT and select Customize. In the customize dialog, select All Commands and scroll down to Microsoft Outlook. But I am assuming that you have the whole Office 2007 suit and not just Word 2007 mixed with Outlook 2003. That combination won't work as Word 2007 needs Outlook 2007 for compatibility. Hope this sorts it for you. Terry "George Lutz" wrote in message ... Graham's macro works very nicely -- thank you, Graham. Terry: I would like to try your suggestion, but Outlook does not seem to be a Command available to me in Word Options | Customize | All Commands. Where can I find the Command to which you are referring? Thanks. George Lutz "Terry Farrell" wrote: George You can add the Outlook command button to the QAT, just like you can add the Send to Mail Recipient tool to the QAT. Terry Farrell "George Lutz" wrote in message ... But I don't want to send the entire Word document -- just the portion of it that is my email. I take notes as I go through the day, and occasionally compose an email that I then want to send. The email is just a small portion of the day's notes. So, I compose the email, then cut and paste its text into Outlook. The button I used in Word 2003 called up Outlook, opened a blank email, and allowed me to paste in the text I had prepared in Word. I also had a button that called up Outlook with an email already addressed to my assistant, who is the recipient of about half of the 20 or so emails I send each day -- very convenient. Amazing that such a useful feature would be eliminated in an "updated" version of Word! I appreciate your replies. however. George Lutz "Terry Farrell" wrote: It was never necessary to copy and paste into a blank email in Outlook. All you ever needed to do from Word was to click on the Send to Mail Recipient tool (in either Word 2002, Word 2003 or Word 2007). When you click on that tool, it adds the standard email address bar to the top of the windows which looks and feels identical to the blank email in Outlook. In Word 2007, you need to add this command button Send Mail to Recipient to the QAT because Microsoft inexplicably left it off the Send Menu. -- Terry Farrell - MSWord MVP "George Lutz" George wrote in message ... I just chagned from Word 2003 to Word 2007. In Word 2003, I had an icon in the toolbar that allowed me to call upOutlook. I.e., I wouudl compose and email in word, then select and copy it, then click on this icno, and an opened up ready for me to paste in the text. I am pretty sure I used the Customixe feature in 2002 to do this. How can I get such an icon in 2007 to land in my Quick Access Toolbar? Thanks. George Lutz |
#40
Posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook,microsoft.public.word.newusers,microsoft.public.word.vba.general
|
|||
|
|||
How to get to email from Word
It would be helpful if you would step through the code and pinpoint the issue more exactly.
Also, I would suggest a bit more precision in setting where to paste the copied content: oItem.Display Set objDoc = oItem.GetInspector.WordEditor Set objSel = objDoc.Windows(1).Selection objSel.Paste -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Graham Mayor" wrote in message ... It just crashes without any vba error message - just the Word has encountered an error and needs to close message, followed by the fault reporting screen. Word then restarts. The error occurs after the prompt for the Subject so presumably the fault lies at Selection.Copy objDoc.Range.Paste .Display On the few occasions when it doesn't crash, the selected formatted text is not pasted into the message window. When Outlook is already running in the background, the macro works as intended in both Word 2003 and 2007 (both with Outlook 2007). -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Sue Mosher [MVP-Outlook] wrote: Which statement causes the crash? Error messages? "Graham Mayor" wrote in message ... Sue The suggestion set the little cogs in motion The following now does work to paste the formatted text into the body of the message, and I have added a routine to grab the addressee information from Outlook. However while it does work when Outlook is running already, it usually crashes Word when Outlook is supposed to be started from the macro. Sub Send_Extract_As_EMail() ' send the document in an Outlook Email message ' 2007 Graham Mayor, Tony Jollans, Doug Robbins ' & Sue Mosher Dim bStarted As Boolean Dim oOutlookApp As Outlook.Application Dim oItem As Outlook.MailItem Dim objDoc As Word.Document Dim strEMail As String strEMail = "PR_EMAIL_ADDRESS" 'Let the user choose the contact from Outlook 'And assign the email address to a variable strEMail = Application.GetAddress("", strEMail, _ False, 1, , , True, True) If strEMail = "" Then MsgBox "User cancelled or no address listed", , "Cancel" End If 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) Set objDoc = oItem.GetInspector.WordEditor With oItem .to = strEMail .Subject = InputBox("Subject?") Selection.Copy objDoc.Range.Paste .Display End With 'Clean up Set oItem = Nothing Set oOutlookApp = Nothing End Sub Sue Mosher [MVP-Outlook] wrote: Yes, it should have been Set not Dim. Sorry for the confusion. "Graham Mayor" wrote in message ... Thanks for that. I assume the second 'Dim' was a typo? Sue Mosher [MVP-Outlook] wrote: You might find the recent discussion at http://www.outlookcode.com/threads.a...essageid=26382 useful, as it was on a similar subject. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). Declare a Word.Document object and instantiate it: Dim objDoc as Word.Document Dim objDoc = MyMessage.GetInspector.WordEditor You'll then get intellisense for objDoc. "Graham Mayor" wrote in message ... The only thing I do in Outlook is extract a line of code from a daily e-mail and paste it into a Word table, using a variation of the code we discussed on an earlier occasion. I don't appear to be able to do anything in code with the object. I don't get an OMG (?) prompt or any other prompt or error message. The Outlook message window opens the addressee and subject are filled and (if nothing is entered in the ".Body =" line) the default theme is used. The cursor is in the body area and nothing is pasted. Pressing CTRL V or clicking the Paste button pastes the formatted text. I don't know if it is a clue, but if I enter .GetInspector and then a period vba prompts with the options - including .WordEditor If I add a period to the end of that, there isn't the usual prompt offering .Range etc (though it doesn't baulk at its addition). It doesn't make any difference whether or not Outlook is running. |
Reply |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
N word, can I pull email addresses from the document then email? | Mailmerge | |||
e-mail merge errors w/ multiple email addresses in email field | Mailmerge | |||
How do I hide email adressess when sending a group contact email? | Microsoft Word Help | |||
How to save email address and subject line in Word's email functio | Microsoft Word Help | |||
Create macro to write email address in email window | Microsoft Word Help |