![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
While editing an email, I'd like to be able to press a button
on a toolbar and have a pre-defined phrase inserted. After looking for code, it seems like this is not the easiest thing to do. Although I have found examples of adding body text AS THE EMAIL IS CREATED, I can't seem to get it to insert body text to an open-for-editing email. TIA for any help or suggestions. ____________________________________________ The impossible just takes a little longer... |
#2
|
|||
|
|||
![]() The opened e-mail is: Application.ActiveInspector.CurrentItem If you want to add text at the current cursor position then you have to use Word as e-mail editor or the Redemption (wwww.dimastr.com). -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Organize eMails: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Wed, 12 Sep 2007 13:39:58 -0700 schrieb Patrick Pirtlemka: While editing an email, I'd like to be able to press a button on a toolbar and have a pre-defined phrase inserted. After looking for code, it seems like this is not the easiest thing to do. Although I have found examples of adding body text AS THE EMAIL IS CREATED, I can't seem to get it to insert body text to an open-for-editing email. TIA for any help or suggestions. ____________________________________________ The impossible just takes a little longer... |
#3
|
|||
|
|||
![]()
Michael -
Many thanks for your reply. I *have* successfully used Redemption for moving attachments, so I should (may) be able to figure this out from here. ____________________________________________ The impossible just takes a little longer... Michael Bauer [MVP - Outlook] wrote: The opened e-mail is: Application.ActiveInspector.CurrentItem If you want to add text at the current cursor position then you have to use Word as e-mail editor or the Redemption (wwww.dimastr.com). [snip] |
#4
|
|||
|
|||
![]()
Michael -
Well, I've gotten it to work, but have a couple of questions. 1. Here's the *working* code: Sub PleasePlot() Set SInspector = CreateObject("Redemption.SafeInspector") SInspector.item = Application.ActiveInspector SInspector.SelText = "Blah blah blah" & vbCr End Sub However, if I use: SInspector.item = Application.ActiveInspector.CurrentItem the text doesn't get inserted. Am I missing something in your original reply? 2. Now, I'd like to grab the Recipient's and CC's names. I've gone back and looked at dimastr.com, but can't quite pull it together. Any suggestions? Once again, thanks for your help. ____________________________________________ The impossible just takes a little longer... Michael Bauer [MVP - Outlook] wrote: The opened e-mail is: Application.ActiveInspector.CurrentItem If you want to add text at the current cursor position then you have to use Word as e-mail editor or the Redemption (wwww.dimastr.com). [snip] |
#5
|
|||
|
|||
![]() 1. Both is correct, the working code works and the other one doesn't. What's the problem? 2. Now use CurrentItem: Set sfMail=CreateObject("Redemption.SafeMailItem") sfMail.Item = Application.ActiveInspector.CurrentItem Now you can loop though sfMail's Recipients collection. And never forget to dispose the Safe*Item.Item object: set sfMail.Item=Nothing set sfMail=Nothing -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Organize eMails: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Thu, 13 Sep 2007 09:28:06 -0700 schrieb Patrick Pirtlemka: Michael - Well, I've gotten it to work, but have a couple of questions. 1. Here's the *working* code: Sub PleasePlot() Set SInspector = CreateObject("Redemption.SafeInspector") SInspector.item = Application.ActiveInspector SInspector.SelText = "Blah blah blah" & vbCr End Sub However, if I use: SInspector.item = Application.ActiveInspector.CurrentItem the text doesn't get inserted. Am I missing something in your original reply? 2. Now, I'd like to grab the Recipient's and CC's names. I've gone back and looked at dimastr.com, but can't quite pull it together. Any suggestions? Once again, thanks for your help. ____________________________________________ The impossible just takes a little longer... Michael Bauer [MVP - Outlook] wrote: The opened e-mail is: Application.ActiveInspector.CurrentItem If you want to add text at the current cursor position then you have to use Word as e-mail editor or the Redemption (wwww.dimastr.com). [snip] |
#6
|
|||
|
|||
![]()
1. Both is correct, the working code works and the other one doesn't.
What's the problem? BG! This answer speaks directly to my general programming approach--Just keep writing stuff until something works. Then, stop. ;^D Thanks, once again, for your help. Works like a charm. ____________________________________________ The impossible just takes a little longer... Michael Bauer [MVP - Outlook] wrote: 1. Both is correct, the working code works and the other one doesn't. What's the problem? 2. Now use CurrentItem: [snip] |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook 2007 - Missing body text when receive forwarded email | TransAction Translators | Outlook - General Queries | 2 | July 24th 07 09:59 AM |
push button on outlook toolbar inserts text to email | jamesd | Add-ins for Outlook | 0 | June 23rd 06 09:44 PM |
Outlook 2003 sending blank emails / text missing from body | Keith | Outlook - General Queries | 3 | June 1st 06 01:57 PM |
How do I append text to the body of a email? | Beginner | Outlook and VBA | 2 | February 9th 06 09:36 PM |
Dragging an email to the Calendar drops the email body text | yan | Outlook - Calandaring | 2 | February 1st 06 01:23 AM |