Quote:
Originally Posted by gmaxey
Well TabValue (assuming that has been set to the value of your long string of replacement text) is too long for a Replacement.Text property.
You could have that long string set somewhere in the document e.g., a bookmark named "bmText" and use:
Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Range
Dim strFind As String
Dim strReplace As String
strFind = "<<testtag>>"
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = strFind
While .Execute
oRng.Text = ActiveDocument.Bookmarks("bmText").Range.Text
oRng.Collapse wdCollapseEnd
Wend
End With
lbl_Exit:
Exit Sub
End Sub
|
Sorry not sure I follow.
Are you suggesting I house all the html content (about 40 lines) in a bookmark?
I am technically not using bookmarks in the overall macro, so not sure that will work.