O
Ocean
I'm trying to program a simple macro in Word XP, but my Visual Basic
skills are not up to the task.
Basically, all I want is a macro that will take a selected section of
text, and add a ">" character to the beginning of each line. That's all. I
need to be able to process emails that do not have their quoted sections
properly prefixed with the ">" character, and add that in. The macro in
question has to work ONLY on selected text, not the whole document (unless
the whole document is selected, of course).
Obviously, doing this for a single line at a time is easy, as I would
only need the following:
-----------------------------
Sub QuoteSingleLine()
Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:=">"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.HomeKey Unit:=wdLine
End Sub
--------------------------------
But setting this up to process a selection of text is another story.
Can anyone offer me some insight on how to accomplish this seemingly
simple task?
Thanks!
skills are not up to the task.
Basically, all I want is a macro that will take a selected section of
text, and add a ">" character to the beginning of each line. That's all. I
need to be able to process emails that do not have their quoted sections
properly prefixed with the ">" character, and add that in. The macro in
question has to work ONLY on selected text, not the whole document (unless
the whole document is selected, of course).
Obviously, doing this for a single line at a time is easy, as I would
only need the following:
-----------------------------
Sub QuoteSingleLine()
Selection.HomeKey Unit:=wdLine
Selection.TypeText Text:=">"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.HomeKey Unit:=wdLine
End Sub
--------------------------------
But setting this up to process a selection of text is another story.
Can anyone offer me some insight on how to accomplish this seemingly
simple task?
Thanks!