A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook 2003 - Button to add body text to an OPEN email



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 12th 07, 09:39 PM posted to microsoft.public.outlook.program_vba
Patrick Pirtle
external usenet poster
 
Posts: 14
Default Outlook 2003 - Button to add body text to an OPEN email

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  
Old September 13th 07, 06:19 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Outlook 2003 - Button to add body text to an OPEN email



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  
Old September 13th 07, 03:24 PM posted to microsoft.public.outlook.program_vba
Patrick Pirtle
external usenet poster
 
Posts: 14
Default Outlook 2003 - Button to add body text to an OPEN email

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  
Old September 13th 07, 05:28 PM posted to microsoft.public.outlook.program_vba
Patrick Pirtle
external usenet poster
 
Posts: 14
Default Outlook 2003 - Button to add body text to an OPEN email

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  
Old September 14th 07, 06:01 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Outlook 2003 - Button to add body text to an OPEN email



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  
Old September 14th 07, 03:15 PM posted to microsoft.public.outlook.program_vba
Patrick Pirtle
external usenet poster
 
Posts: 14
Default Outlook 2003 - Button to add body text to an OPEN email

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
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


All times are GMT +1. The time now is 10:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.