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 Macro - TypeText



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 19th 07, 04:40 PM posted to microsoft.public.outlook.program_vba
Kooltou
external usenet poster
 
Posts: 3
Default Outlook Macro - TypeText

Hello!

I need to write a simple macro for Outlook 2007.

I would like it to simply insert several lines of text in the active message
window.

In Outlook/Word 2003, I used the selection.typetext command. What would I
use in Outlook 2007?

If it matters, the messages are (and need to be) plain text.

Thanks in advance!

Kind Regards,

  #2  
Old March 19th 07, 05:50 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Outlook Macro - TypeText

You should be able to use the same technique in Outlook 2007, since Word is always the editor.

--
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/jumpstart.aspx

"Kooltou" wrote in message ...
Hello!

I need to write a simple macro for Outlook 2007.

I would like it to simply insert several lines of text in the active message
window.

In Outlook/Word 2003, I used the selection.typetext command. What would I
use in Outlook 2007?

If it matters, the messages are (and need to be) plain text.

Thanks in advance!

Kind Regards,

  #3  
Old March 19th 07, 06:27 PM posted to microsoft.public.outlook.program_vba
Kooltou
external usenet poster
 
Posts: 3
Default Outlook Macro - TypeText

Hello!

Thanks for the reply.

Here was my previous code:

~~~~~~~~~
Sub InsertText()
Selection.TypeText Text:="Hello!"
End Sub
~~~~~~~~~

However, VBA does not now recognize the 'application' object, and I get an
error message "Object Required"

Thank you,

"Sue Mosher [MVP-Outlook]" wrote:

You should be able to use the same technique in Outlook 2007, since Word is always the editor.

--
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/jumpstart.aspx

"Kooltou" wrote in message ...
Hello!

I need to write a simple macro for Outlook 2007.

I would like it to simply insert several lines of text in the active message
window.

In Outlook/Word 2003, I used the selection.typetext command. What would I
use in Outlook 2007?

If it matters, the messages are (and need to be) plain text.

Thanks in advance!

Kind Regards,


  #4  
Old March 19th 07, 10:50 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Outlook Macro - TypeText

Your previous code was apparently a Word macro, not an Outlook macro. In an Outlook macro, you must first return a Word.Document object from the current item. For example:

Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.TypeText Text:="Hello!"

--
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/jumpstart.aspx

"Kooltou" wrote in message ...
Hello!

Thanks for the reply.

Here was my previous code:

~~~~~~~~~
Sub InsertText()
Selection.TypeText Text:="Hello!"
End Sub
~~~~~~~~~

However, VBA does not now recognize the 'application' object, and I get an
error message "Object Required"

Thank you,

"Sue Mosher [MVP-Outlook]" wrote:

You should be able to use the same technique in Outlook 2007, since Word is always the editor.



"Kooltou" wrote in message ...
Hello!

I need to write a simple macro for Outlook 2007.

I would like it to simply insert several lines of text in the active message
window.

In Outlook/Word 2003, I used the selection.typetext command. What would I
use in Outlook 2007?

If it matters, the messages are (and need to be) plain text.

Thanks in advance!

Kind Regards,


  #5  
Old March 20th 07, 05:55 AM posted to microsoft.public.outlook.program_vba
Kooltou
external usenet poster
 
Posts: 3
Default Outlook Macro - TypeText

Hi!

I have it all working now.

Thank you for your assistance!

Kind Regards,



"Sue Mosher [MVP-Outlook]" wrote:

Your previous code was apparently a Word macro, not an Outlook macro. In an Outlook macro, you must first return a Word.Document object from the current item. For example:

Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.TypeText Text:="Hello!"

--
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/jumpstart.aspx

"Kooltou" wrote in message ...
Hello!

Thanks for the reply.

Here was my previous code:

~~~~~~~~~
Sub InsertText()
Selection.TypeText Text:="Hello!"
End Sub
~~~~~~~~~

However, VBA does not now recognize the 'application' object, and I get an
error message "Object Required"

Thank you,

"Sue Mosher [MVP-Outlook]" wrote:

You should be able to use the same technique in Outlook 2007, since Word is always the editor.



"Kooltou" wrote in message ...
Hello!

I need to write a simple macro for Outlook 2007.

I would like it to simply insert several lines of text in the active message
window.

In Outlook/Word 2003, I used the selection.typetext command. What would I
use in Outlook 2007?

If it matters, the messages are (and need to be) plain text.

Thanks in advance!

Kind Regards,



 




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 macro abends but Word macro runs successfully Jreue Outlook and VBA 0 December 14th 06 12:55 AM
Outlook Macro - help please [email protected] Outlook - General Queries 0 November 29th 06 12:22 PM
Call macro stored in Excel workbook from Outlook's macro Gvaram Outlook and VBA 5 October 4th 06 07:26 AM
outlook macro matt Outlook and VBA 1 January 30th 06 02:30 PM
VB and outlook macro need help jbullington Outlook and VBA 1 January 10th 06 04:22 PM


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