G
Gary Fritz
I wanted a macro to apply a common format that I use in my work. No
problem, I started recording a macro, assigned it to a key, then used the
Style pulldown to select "Code". It changed to Courier font and Code style
like it should. I ended the recording, and tried applying it. It changed
the style to "Caption" !
I tried recording macros using other styles, and they worked fine. I tried
recording macros while I applied the Code style to highlighted text, and to
an entire paragraph. Both of them changed to Caption.
The macros look like this:
Sub GF_CodeFont()
'
' GF_CodeFont Macro
' Macro recorded 7/5/2007 by Gary Fritz
'
Selection.Style = ActiveDocument.Styles("Code Char")
End Sub
Sub GF_CodePara()
'
' GF_CodePara Macro
' Macro recorded 7/5/2007 by Gary Fritz
'
Selection.Style = ActiveDocument.Styles("Code")
End Sub
Any guesses why it refuses to apply the Code style??
Gary
problem, I started recording a macro, assigned it to a key, then used the
Style pulldown to select "Code". It changed to Courier font and Code style
like it should. I ended the recording, and tried applying it. It changed
the style to "Caption" !
I tried recording macros using other styles, and they worked fine. I tried
recording macros while I applied the Code style to highlighted text, and to
an entire paragraph. Both of them changed to Caption.
The macros look like this:
Sub GF_CodeFont()
'
' GF_CodeFont Macro
' Macro recorded 7/5/2007 by Gary Fritz
'
Selection.Style = ActiveDocument.Styles("Code Char")
End Sub
Sub GF_CodePara()
'
' GF_CodePara Macro
' Macro recorded 7/5/2007 by Gary Fritz
'
Selection.Style = ActiveDocument.Styles("Code")
End Sub
Any guesses why it refuses to apply the Code style??
Gary