Download the DOC file here to learn how
http://www.microsoft.com/office/previous/outlook/supreasy.asp
Mike
> i'd like to have a macro that i can run which will insert
> a specified list of words. can anyone tell me the code to
> insert text into an outlook message.
>
> thanks
Try this macro:
Sub InsertWordsIntoEmailBody()
Dim objInsp As Outlook.Inspector, objItem As Object
Dim strWordArray(5) As String
Set objInsp = Outlook.ActiveInspector
If objInsp Is Nothing Then
'No open e-mail message
Exit Sub
End If
Set objItem = objInsp.CurrentItem
strWordArray(0) = "My"
strWordArray(1) = "string"
strWordArray(2) = "array"
strWordArray(3) = "list"
strWordArray(4) = "of"
strWordArray(5) = "words"
objItem.Body = Join(strWordArray, ";") & vbNewLine & vbNewLine &
objItem.Body
End Sub
--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/
> i'd like to have a macro that i can run which will insert
> a specified list of words. can anyone tell me the code to
> insert text into an outlook message.
>
> thanks
david - 28 Aug 2004 12:49 GMT
many thanks that works.
can you tell me how I can insert this list at the point
in the email where the cursor currently is?
>-----Original Message-----
>Try this macro:
[quoted text clipped - 37 lines]
>>
>.
Eric Legault [MVP - Outlook] - 30 Aug 2004 06:13 GMT
Unfortunately, you can't do that with the Outlook Object Model. You need to
use the SafeInspector object from the third-party Redemption tool
(http://www.dimastr.com).
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/
> many thanks that works.
> can you tell me how I can insert this list at the point
[quoted text clipped - 44 lines]
> >>
> >.
Sriram - 31 Aug 2004 06:29 GMT
If you set Word as the email editor, you can use the Word AutoText feature
without any programming, to insert text at the cursor.
> many thanks that works.
> can you tell me how I can insert this list at the point
> in the email where the cursor currently is?