String too long...

G

Greg Maxey

My understanding is you had a problem finding a tag and replacing it
with a long sting (>255 characters).

I think we agree that this will solve that problem without using the
users clipboard:

Sub Test1()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "<Additional_Info>"
While .Execute
oRng.Text = String(256, "1")
oRng.Collapse wdCollapseEnd
Wend
End With
End Sub

Other than theorectical debate about greater or lesser solutions, what
answer or other information are you looking for in this discussion?
 
M

mike

While I don't think Jezabel would agree. If you now go back to my very first
posting, the question remains...
 
G

Greg Maxey

Mike,

I cobbled together the following to show that you could employ
selection.typetext to do the job.

I still don't know why you would want to chop wood with a dull axe.

Sub ScratchMacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "<myTag>"
While .Execute
Selection.Start = oRng.Start
Selection.End = oRng.End
Selection.Delete
Selection.TypeText (String(256, "W"))
oRng.Collapse wdCollapseEnd
Wend
End With
End Sub
 
M

mike

So that's how, huh..

Nice...

Kind of like the Australian fellows Super Range.

You guys are Super with your perseverance!

It is standard protocol for investigations. Typically, research two to three commendable solutions, develop a $ costing for each, provide pro's and con's for each. My overall campaign for this application's overhaul is Performance Tuning, it is expected that a selection (no pun) be brought to the bench. There is where I have profiling tools that'll highlight the performers.

FWIW, my background is 20 years IBM/Intel Assembler and C/C++. Please allow me to attempt to reciprocate your most excellent efforts if ever the need!

Thanks again Greg, sincerely,

- Mike
 

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