B
BobS
I am trying to create a simple macro to insert some text into an OL 2007
message. When I run the macro, I am getting a compile error
"User-defined type not defined." Can someone tell me what commands I
need to insert or change? Thank you.
This is my code.
Sub Greetings()
'
' Greetings Macro
' Macro recorded 9/4/2009 by Bob
'
Dim objDoc As Word.Document
Dim objSel As Word.Selection
On Error Resume Next
' get a Word.Selection from the open Outlook item
Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
' now do what you want with the Selection
objSel.TypeText Text:= _
"Greetings Patrick,"
objSel.TypeParagraph
objSel.TypeParagraph
objSel.TypeParagraph
objSel.TypeParagraph
objSel.TypeText Text:="God is good, all the time, "
objSel.TypeParagraph
objSel.TypeText Text:="Bob "
objSel.MoveUp Unit:=wdLine, Count:=4
Set objDoc = Nothing
Set objSel = Nothing
End Sub
message. When I run the macro, I am getting a compile error
"User-defined type not defined." Can someone tell me what commands I
need to insert or change? Thank you.
This is my code.
Sub Greetings()
'
' Greetings Macro
' Macro recorded 9/4/2009 by Bob
'
Dim objDoc As Word.Document
Dim objSel As Word.Selection
On Error Resume Next
' get a Word.Selection from the open Outlook item
Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
' now do what you want with the Selection
objSel.TypeText Text:= _
"Greetings Patrick,"
objSel.TypeParagraph
objSel.TypeParagraph
objSel.TypeParagraph
objSel.TypeParagraph
objSel.TypeText Text:="God is good, all the time, "
objSel.TypeParagraph
objSel.TypeText Text:="Bob "
objSel.MoveUp Unit:=wdLine, Count:=4
Set objDoc = Nothing
Set objSel = Nothing
End Sub