M
mtodeditor
Version: 2004
Operating System: Mac OS X 10.4 (Tiger)
Processor: Intel
I'm working on a MacBook Pro, Intel processor, on OS 10.4.11, and using Word 2004 (v. 11.5.0). Client sends files that have lots of styles applied, which need to be changed to markup tags for the publisher. She's created a series of macros that will find the text in a given style, add the open and close tags, then select the text and move it to be within the set of tags. When I tried to run one of these macros, I got the "Compile error in hidden module: NewMacros" message. The client also sent one of the macros' text in email, which I've pasted below. I tried to run compile in VBE, which balked on the lines .MatchKashida = False / .MatchDiacritics = False / .MatchAlefHamza = False / .MatchControl = False, so I tried removing those. Next pass through it stopped at this line, which I do not think I can remove without losing some of the function I need:
If InStrRev(Selection, " ") = Len(Selection) Then
Specifically, it objected to InStrRev. At this point, I stopped trying to debug, and turned to this forum for help.
Is there any hope for converting this macro into a usable one for Word 2004, or should I just start over and try creating them on my own?
Thanks in advance,
Mary
Sub MarkCheckboxes()
'
' MarkCheckboxes Macro
' Macro recorded 1/16/2008 by LB
'
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("checkboxes")
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
'If InStr(Selection, " ") <> 0 Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
'End If
Selection.TypeText Text:="<check></check>"
'Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
'Selection.Extend
Selection.Find.Execute
If InStrRev(Selection, " ") = Len(Selection) Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
End If
WordBasic.MoveText
Selection.MoveLeft Unit:=wdCharacter, Count:=9
WordBasic.OK
End Sub
Operating System: Mac OS X 10.4 (Tiger)
Processor: Intel
I'm working on a MacBook Pro, Intel processor, on OS 10.4.11, and using Word 2004 (v. 11.5.0). Client sends files that have lots of styles applied, which need to be changed to markup tags for the publisher. She's created a series of macros that will find the text in a given style, add the open and close tags, then select the text and move it to be within the set of tags. When I tried to run one of these macros, I got the "Compile error in hidden module: NewMacros" message. The client also sent one of the macros' text in email, which I've pasted below. I tried to run compile in VBE, which balked on the lines .MatchKashida = False / .MatchDiacritics = False / .MatchAlefHamza = False / .MatchControl = False, so I tried removing those. Next pass through it stopped at this line, which I do not think I can remove without losing some of the function I need:
If InStrRev(Selection, " ") = Len(Selection) Then
Specifically, it objected to InStrRev. At this point, I stopped trying to debug, and turned to this forum for help.
Is there any hope for converting this macro into a usable one for Word 2004, or should I just start over and try creating them on my own?
Thanks in advance,
Mary
Sub MarkCheckboxes()
'
' MarkCheckboxes Macro
' Macro recorded 1/16/2008 by LB
'
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("checkboxes")
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
'If InStr(Selection, " ") <> 0 Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1
'End If
Selection.TypeText Text:="<check></check>"
'Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend
'Selection.Extend
Selection.Find.Execute
If InStrRev(Selection, " ") = Len(Selection) Then
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
End If
WordBasic.MoveText
Selection.MoveLeft Unit:=wdCharacter, Count:=9
WordBasic.OK
End Sub