Re: Search and 'Replace' parameter too long?
From: Greg (gmaxey_at_mvps.org)
Date: 02/03/05
- Next message: Ol: "RE: How do I hide a section or a page (not only text) in word 2003?"
- Previous message: Andrew Hilsher: "re:How To Use Automation to Get and to Set Office Document Properties"
- In reply to: Helmut Weber: "Re: Search and 'Replace' parameter too long?"
- Next in thread: Helmut Weber: "Re: Search and 'Replace' parameter too long?"
- Reply: Helmut Weber: "Re: Search and 'Replace' parameter too long?"
- Reply: Dave Lett: "Re: Search and 'Replace' parameter too long?"
- Messages sorted by: [ date ] [ thread ]
Date: 3 Feb 2005 13:10:02 -0800
Helmut,
Your solution is very clever. While Dave's method of using the
clipboard works for Replace, I don't know how, or if, you could use the
clipboard for both search and replace strings longer than 254
characters.
I have since realized that the input box in not suitable for defining
the long string (> 254 characters). I have since altered my version to
get the strings from a separate document:
Dim oSourceDoc As Document
Set oSourceDoc = Documents.Open(FileName:="C:\Test.doc")
txtFind = oSourceDoc.Paragraphs(1).Range.Text
txtReplace = oSourceDoc.Paragraphs(2).Range.Text
oSourceDoc.Close
WRT the Boolean return value. I am not very familiar with passing
information between routines. It seems like I should be able to
control the loop without the added value Esc. Something like
Do
sF = txtFind
sR = txtReplace
ReplaceLong(sF, sR)
Loop While ReplaceLong = True
but that doesn't work.
Profunde Cogitate
Greg
- Next message: Ol: "RE: How do I hide a section or a page (not only text) in word 2003?"
- Previous message: Andrew Hilsher: "re:How To Use Automation to Get and to Set Office Document Properties"
- In reply to: Helmut Weber: "Re: Search and 'Replace' parameter too long?"
- Next in thread: Helmut Weber: "Re: Search and 'Replace' parameter too long?"
- Reply: Helmut Weber: "Re: Search and 'Replace' parameter too long?"
- Reply: Dave Lett: "Re: Search and 'Replace' parameter too long?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|