Brandon Garnett
asked on
Inserting text into a word document using a macro
I am trying to write a macro to insert a word at the beginning of each paragraph based on a selection in a Microsoft Word document. For example, "1. Some text here" would change to "WORD 1. Some text here" after running the macro. So far I have this, but I only want the Macro to run with a selection, not the whole document.
Sub addNotes()
iParCount = ActiveDocument.Paragraphs. Count
For j = 1 To iParCount
sMyPar = "Note " + ActiveDocument.Paragraphs( j).Range.T ext
ActiveDocument.Paragraphs( j).Range.T ext = sMyPar
Next j
End Sub
Thanks.
Sub addNotes()
iParCount = ActiveDocument.Paragraphs.
For j = 1 To iParCount
sMyPar = "Note " + ActiveDocument.Paragraphs(
ActiveDocument.Paragraphs(
Next j
End Sub
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER