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
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