T
Thomas M.
Word 2003
I have the following macro in a Word 2003 template.
Sub DocDevFix()
If Selection.Start = Selection.End Then
Selection.Style = ActiveDocument.Styles("DocDevFix")
Else
Selection.Style = ActiveDocument.Styles("DocDevFix Char")
End If
End Sub
Basically, if the insertion point is a single point then the macro should
act on the paragraph, and if a range is selected then it should act on that
selection. DocDevFix is just a custom style that I created in which the
font is red and the line spacing is set to exactly 15.
If there is no selection, then the macro works. However, if there is a
selection then the macro errors out and shows a dialog box that contains
nothing but OK and Help buttons (no error message or text of any kind). I
seem to remember that this worked at one time, so I'm not sure why it's not
working now. Can someone tell me what the problem is?
Also, if the macro is run on text that is outlined, it removes the outline
numbering. If anyone has a clever idea for how to avoid that and leave the
outline numbering intact, I would be grateful for the advice on how to do
that.
Thanks for any help that you may provide.
--Tom
I have the following macro in a Word 2003 template.
Sub DocDevFix()
If Selection.Start = Selection.End Then
Selection.Style = ActiveDocument.Styles("DocDevFix")
Else
Selection.Style = ActiveDocument.Styles("DocDevFix Char")
End If
End Sub
Basically, if the insertion point is a single point then the macro should
act on the paragraph, and if a range is selected then it should act on that
selection. DocDevFix is just a custom style that I created in which the
font is red and the line spacing is set to exactly 15.
If there is no selection, then the macro works. However, if there is a
selection then the macro errors out and shows a dialog box that contains
nothing but OK and Help buttons (no error message or text of any kind). I
seem to remember that this worked at one time, so I'm not sure why it's not
working now. Can someone tell me what the problem is?
Also, if the macro is run on text that is outlined, it removes the outline
numbering. If anyone has a clever idea for how to avoid that and leave the
outline numbering intact, I would be grateful for the advice on how to do
that.
Thanks for any help that you may provide.
--Tom