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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
User defined type not defined
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 |
#2
|
|||
|
|||
User defined type not defined
"BobS" wrote in message
... 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. Ask code questions in microsoft.public.outlook.program_vba -- Brian Tillman [MVP-Outlook] |
Thread Tools | |
Display Modes | |
|
|