Convert Windows Macro for use in Mac Word

P

Patrick

I have this macro that I've been using in Windows, but it simply won't
take on a Mac. Is there some sort of conversion that I need to do?

Sub HTMLReplace()

'Replace BOLD.
With ActiveDocument.Range(Start:=Selection.Start,
End:=Selection.End).Find
.ClearFormatting
.Font.Bold = True
.Format = True
.MatchWildcards = True
.Replacement.ClearFormatting
.Replacement.Font.Bold = False
.Execute Forward:=True, Replace:=wdReplaceAll, _
FindText:="", ReplaceWith:="<b>^&</b>"
End With

'Replace ITALIC.
With ActiveDocument.Range(Start:=Selection.Start,
End:=Selection.End).Find
.ClearFormatting
.Font.Italic = True
.Format = True
.MatchWildcards = True
.Replacement.ClearFormatting
.Replacement.Font.Italic = False
.Execute Forward:=True, Replace:=wdReplaceAll, _
FindText:="", ReplaceWith:="<i>^&</i>"
End With

'Replace UNDERLINE.
With ActiveDocument.Range(Start:=Selection.Start,
End:=Selection.End).Find
.ClearFormatting
.Font.Underline = True
.Format = True
.MatchWildcards = True
.Replacement.ClearFormatting
.Replacement.Font.Underline = False
.Execute Forward:=True, Replace:=wdReplaceAll, _
FindText:="", ReplaceWith:="<u>^&</u>"
End With

'Replace PARAGRAPH.
With ActiveDocument.Range(Start:=Selection.Start,
End:=Selection.End).Find
.ClearFormatting
.Format = True
.MatchWildcards = True
.Replacement.ClearFormatting
.Execute Forward:=True, Replace:=wdReplaceAll, _
FindText:="^13", ReplaceWith:="<br>"
End With

'Replace TAB.
With ActiveDocument.Range(Start:=Selection.Start,
End:=Selection.End).Find
.ClearFormatting
.Format = True
.MatchWildcards = True
.Replacement.ClearFormatting
.Execute Forward:=True, Replace:=wdReplaceAll, _
FindText:="^9", ReplaceWith:="<tab>"
End With


End Sub
 
P

Phillip Jones, C.E.T.

If your trying to use Office 2008 , Macro technology was ripped out of
it. Now Office2004 (Word2004) will or should.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top