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

Creating text macro for mail



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 8th 07, 09:42 AM posted to microsoft.public.outlook.program_vba
Boghound
external usenet poster
 
Posts: 7
Default Creating text macro for mail

Would someone explain to me in "simple English" how to create a text macro
for email messages using VBA. The help files are useless. I get as far as
putting the code in. Then that's it. Macro will not run and comes back with
error message "424" object required.
Life was so much easier with 2003!!!!!
  #2  
Old June 8th 07, 01:49 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Creating text macro for mail

What do you mean by "a text macro for email messages" ? Please show the code you already have, to save us the trouble of going over what you already know, and indicate where the error occurs. What was easier in 2003 that you're now trying to accomplish in 2007? Is that what you have? You didn't say explicitly.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/article.aspx?id=54

"boghound" wrote in message ...
Would someone explain to me in "simple English" how to create a text macro
for email messages using VBA. The help files are useless. I get as far as
putting the code in. Then that's it. Macro will not run and comes back with
error message "424" object required.
Life was so much easier with 2003!!!!!

  #3  
Old June 8th 07, 02:15 PM posted to microsoft.public.outlook.program_vba
Boghound
external usenet poster
 
Posts: 7
Default Creating text macro for mail

It was easier to create a text macro for a mail message in 2003 because you
just used "record a macro" in word!!!!!
Here's the code;

Sub Macro1()
'
' Macro1 Macro
'
'
Selection.Font.Name = "Comic Sans MS"
Selection.Font.Italic = wdToggle
Selection.TypeText Text:="Hi,"
Selection.TypeParagraph
Selection.TypeText Text:= _
"Thanks for purchase and prompt payment. Will mail Tuesday an"
Selection.TypeText Text:="d it should take around 4 to 7 working days."
Selection.TypeParagraph
Selection.TypeText Text:="Regards"
Selection.TypeParagraph
Selection.TypeText Text:="Steve"
End Sub


"Sue Mosher [MVP-Outlook]" wrote:

What do you mean by "a text macro for email messages" ? Please show the code you already have, to save us the trouble of going over what you already know, and indicate where the error occurs. What was easier in 2003 that you're now trying to accomplish in 2007? Is that what you have? You didn't say explicitly.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/article.aspx?id=54

"boghound" wrote in message ...
Would someone explain to me in "simple English" how to create a text macro
for email messages using VBA. The help files are useless. I get as far as
putting the code in. Then that's it. Macro will not run and comes back with
error message "424" object required.
Life was so much easier with 2003!!!!!


  #4  
Old June 8th 07, 03:34 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Creating text macro for mail

It would have been nice if you'd actually answered the questions directly rather than having us read between the lines of your code to find out that what you want to do is create a VBA macro in Outlook that can insert text into the body of a mail message. In any case, the piece that's not obvious is the starting point, the actual code to get the Selection object. That looks like this:

Sub InsertText()
Dim objDoc as Word.Document
DIm objSel as Word.Selection
Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.TypeText Text:="Hi,"
End Sub

In other words, the objSel object above works the same as the Selection object in your code snippet. Don't forget to add a reference to the Microsoft Word library to your Outlook VBA project.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/article.aspx?id=54

"boghound" wrote in message ...
It was easier to create a text macro for a mail message in 2003 because you
just used "record a macro" in word!!!!!
Here's the code;

Sub Macro1()
'
' Macro1 Macro
'
'
Selection.Font.Name = "Comic Sans MS"
Selection.Font.Italic = wdToggle
Selection.TypeText Text:="Hi,"
Selection.TypeParagraph
Selection.TypeText Text:= _
"Thanks for purchase and prompt payment. Will mail Tuesday an"
Selection.TypeText Text:="d it should take around 4 to 7 working days."
Selection.TypeParagraph
Selection.TypeText Text:="Regards"
Selection.TypeParagraph
Selection.TypeText Text:="Steve"
End Sub


"Sue Mosher [MVP-Outlook]" wrote:

What do you mean by "a text macro for email messages" ? Please show the code you already have, to save us the trouble of going over what you already know, and indicate where the error occurs. What was easier in 2003 that you're now trying to accomplish in 2007? Is that what you have? You didn't say explicitly.

"boghound" wrote in message ...
Would someone explain to me in "simple English" how to create a text macro
for email messages using VBA. The help files are useless. I get as far as
putting the code in. Then that's it. Macro will not run and comes back with
error message "424" object required.
Life was so much easier with 2003!!!!!


  #5  
Old June 8th 07, 05:50 PM posted to microsoft.public.outlook.program_vba
Boghound
external usenet poster
 
Posts: 7
Default Creating text macro for mail

Thanks for reply but it would have been rather more "congenial" without the
"snide" remarks....Perhaps if you came down off your pedestal now and again
to rub shoulders with the less knowledgeable, your tone might be a bit less
"school teacherish" but I doubt it!

"Sue Mosher [MVP-Outlook]" wrote:

It would have been nice if you'd actually answered the questions directly rather than having us read between the lines of your code to find out that what you want to do is create a VBA macro in Outlook that can insert text into the body of a mail message. In any case, the piece that's not obvious is the starting point, the actual code to get the Selection object. That looks like this:

Sub InsertText()
Dim objDoc as Word.Document
DIm objSel as Word.Selection
Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.TypeText Text:="Hi,"
End Sub

In other words, the objSel object above works the same as the Selection object in your code snippet. Don't forget to add a reference to the Microsoft Word library to your Outlook VBA project.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/article.aspx?id=54

"boghound" wrote in message ...
It was easier to create a text macro for a mail message in 2003 because you
just used "record a macro" in word!!!!!
Here's the code;

Sub Macro1()
'
' Macro1 Macro
'
'
Selection.Font.Name = "Comic Sans MS"
Selection.Font.Italic = wdToggle
Selection.TypeText Text:="Hi,"
Selection.TypeParagraph
Selection.TypeText Text:= _
"Thanks for purchase and prompt payment. Will mail Tuesday an"
Selection.TypeText Text:="d it should take around 4 to 7 working days."
Selection.TypeParagraph
Selection.TypeText Text:="Regards"
Selection.TypeParagraph
Selection.TypeText Text:="Steve"
End Sub


"Sue Mosher [MVP-Outlook]" wrote:

What do you mean by "a text macro for email messages" ? Please show the code you already have, to save us the trouble of going over what you already know, and indicate where the error occurs. What was easier in 2003 that you're now trying to accomplish in 2007? Is that what you have? You didn't say explicitly.

"boghound" wrote in message ...
Would someone explain to me in "simple English" how to create a text macro
for email messages using VBA. The help files are useless. I get as far as
putting the code in. Then that's it. Macro will not run and comes back with
error message "424" object required.
Life was so much easier with 2003!!!!!


  #6  
Old June 8th 07, 06:43 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Creating text macro for mail

So, suggestions on how you can get faster, more focused responses to your posts are not useful information? Well, so be it.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/article.aspx?id=54

"boghound" wrote in message ...
Thanks for reply but it would have been rather more "congenial" without the
"snide" remarks....Perhaps if you came down off your pedestal now and again
to rub shoulders with the less knowledgeable, your tone might be a bit less
"school teacherish" but I doubt it!

"Sue Mosher [MVP-Outlook]" wrote:

It would have been nice if you'd actually answered the questions directly rather than having us read between the lines of your code to find out that what you want to do is create a VBA macro in Outlook that can insert text into the body of a mail message. In any case, the piece that's not obvious is the starting point, the actual code to get the Selection object. That looks like this:

Sub InsertText()
Dim objDoc as Word.Document
DIm objSel as Word.Selection
Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.TypeText Text:="Hi,"
End Sub

In other words, the objSel object above works the same as the Selection object in your code snippet. Don't forget to add a reference to the Microsoft Word library to your Outlook VBA project.

"boghound" wrote in message ...
It was easier to create a text macro for a mail message in 2003 because you
just used "record a macro" in word!!!!!
Here's the code;

Sub Macro1()
'
' Macro1 Macro
'
'
Selection.Font.Name = "Comic Sans MS"
Selection.Font.Italic = wdToggle
Selection.TypeText Text:="Hi,"
Selection.TypeParagraph
Selection.TypeText Text:= _
"Thanks for purchase and prompt payment. Will mail Tuesday an"
Selection.TypeText Text:="d it should take around 4 to 7 working days."
Selection.TypeParagraph
Selection.TypeText Text:="Regards"
Selection.TypeParagraph
Selection.TypeText Text:="Steve"
End Sub


"Sue Mosher [MVP-Outlook]" wrote:

What do you mean by "a text macro for email messages" ? Please show the code you already have, to save us the trouble of going over what you already know, and indicate where the error occurs. What was easier in 2003 that you're now trying to accomplish in 2007? Is that what you have? You didn't say explicitly.

"boghound" wrote in message ...
Would someone explain to me in "simple English" how to create a text macro
for email messages using VBA. The help files are useless. I get as far as
putting the code in. Then that's it. Macro will not run and comes back with
error message "424" object required.
Life was so much easier with 2003!!!!!


 




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
creating a macro using FIND Ale Outlook and VBA 1 April 19th 07 11:12 PM
Creating macro that will sort emails into folders based on text in body mugginns Outlook and VBA 5 October 3rd 06 08:49 AM
Creating a macro... I think Casey Outlook - General Queries 9 July 27th 06 06:29 PM
Creating a new Macro in Outlook jpotucek Outlook and VBA 3 April 27th 06 03:30 PM
Macro to change font of selected text in mail message? Joe HM Outlook and VBA 1 April 6th 06 07:06 PM


All times are GMT +1. The time now is 07:10 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.