M
Mike Hood
Hello there,
I'm brand-new to VBA and am trying to automate the following:
I have a message open; I click on Forward and manually enter the address.
Then Tab three times to the body of the text area. Ctrl-Home to make sure
I'm at the top, then enter some text - this is always the *same* text for
each message:
Blah blah line one
<blank line>
Stuff n nonsense on second line.
Then I need to go back up to the end of line one where I ctrl-v to paste
something I've previously copied to the clipboard (could always do this
straight after typing line one, I just thought it made sense to keep all the
"insert text" stuff together).
I tried recording doing this in Word (as there doesn't seem to be a recorder
in Outlook) and pasting it in to a new macro in Outlook, thusly:
Sub MyMacroName()
Selection.TypeText Text:= _
"Typing starts here. Then we have a couple of returns..."
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText Text:="...then we end."
End Sub
I tested it out before adding the pasting bit, but it says "Run-time error
'424' Object required"
Searching for this in Google gives lots of hits, all quite advanced, so I
thought I'd try out you guys and gals. What do I need to add? - I'm sure it
must be dead simple...
Sorry, this is Outlook 2000 BTW.
Thanks.
I'm brand-new to VBA and am trying to automate the following:
I have a message open; I click on Forward and manually enter the address.
Then Tab three times to the body of the text area. Ctrl-Home to make sure
I'm at the top, then enter some text - this is always the *same* text for
each message:
Blah blah line one
<blank line>
Stuff n nonsense on second line.
Then I need to go back up to the end of line one where I ctrl-v to paste
something I've previously copied to the clipboard (could always do this
straight after typing line one, I just thought it made sense to keep all the
"insert text" stuff together).
I tried recording doing this in Word (as there doesn't seem to be a recorder
in Outlook) and pasting it in to a new macro in Outlook, thusly:
Sub MyMacroName()
Selection.TypeText Text:= _
"Typing starts here. Then we have a couple of returns..."
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText Text:="...then we end."
End Sub
I tested it out before adding the pasting bit, but it says "Run-time error
'424' Object required"
Searching for this in Google gives lots of hits, all quite advanced, so I
thought I'd try out you guys and gals. What do I need to add? - I'm sure it
must be dead simple...
Sorry, this is Outlook 2000 BTW.
Thanks.