BBaron
asked on
MS Word Find/Replace Problem
Hi All,
I have a problem in that I am filling a word document with data from a database by replacing 'codes' with the data upon loading the word document. The problem that I have is that my documents are now very slow to open due to the fact that I am perfoming alot of find/replace procedures on the document, using the code below. Is there anyway of speeding up the find/replace procedure or any other suggestions on how we could replace codes in the document quicker?
many thanx for any help
Ben
myWordApp.Selection.find.C learFormat ting
myWordApp.Selection.find.r eplacement .ClearForm atting
With myWordApp.Selection.find
.Text = findtext
.replacement.Text = replacetext
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
myWordApp.Selection.find.E xecute Replace:=wdReplaceAll
I have a problem in that I am filling a word document with data from a database by replacing 'codes' with the data upon loading the word document. The problem that I have is that my documents are now very slow to open due to the fact that I am perfoming alot of find/replace procedures on the document, using the code below. Is there anyway of speeding up the find/replace procedure or any other suggestions on how we could replace codes in the document quicker?
many thanx for any help
Ben
myWordApp.Selection.find.C
myWordApp.Selection.find.r
With myWordApp.Selection.find
.Text = findtext
.replacement.Text = replacetext
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
myWordApp.Selection.find.E
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Guys,
thanx for the suggestion about the form fields tampabay420 Im going to investigate it a little more.. if you could perhaps email me on ben@brokerpartners.co.uk so I could ask more indepth questions and explain what Im doing a little me that would be great...
Eddykt,
the number of replaces depends on how many 'datacodes' I have in the template (user defined). so a basic document could be doing up to 100 finds..
It is definately the finds that is taking the time, I have traced it...
At some sites it can take up to a minute to open a word document and fill with data, so I obviously need to get it sorted..
thanx for the suggestion about the form fields tampabay420 Im going to investigate it a little more.. if you could perhaps email me on ben@brokerpartners.co.uk so I could ask more indepth questions and explain what Im doing a little me that would be great...
Eddykt,
the number of replaces depends on how many 'datacodes' I have in the template (user defined). so a basic document could be doing up to 100 finds..
It is definately the finds that is taking the time, I have traced it...
At some sites it can take up to a minute to open a word document and fill with data, so I obviously need to get it sorted..
ASKER
Hi Guys,
thanx for the suggestion about the form fields tampabay420 Im going to investigate it a little more.. if you could perhaps email me on ben@brokerpartners.co.uk so I could ask more indepth questions and explain what Im doing a little me that would be great...
Eddykt,
the number of replaces depends on how many 'datacodes' I have in the template (user defined). so a basic document could be doing up to 100 finds..
It is definately the finds that is taking the time, I have traced it...
At some sites it can take up to a minute to open a word document and fill with data, so I obviously need to get it sorted..
thanx for the suggestion about the form fields tampabay420 Im going to investigate it a little more.. if you could perhaps email me on ben@brokerpartners.co.uk so I could ask more indepth questions and explain what Im doing a little me that would be great...
Eddykt,
the number of replaces depends on how many 'datacodes' I have in the template (user defined). so a basic document could be doing up to 100 finds..
It is definately the finds that is taking the time, I have traced it...
At some sites it can take up to a minute to open a word document and fill with data, so I obviously need to get it sorted..
You should not close the question and ask the question here
?->
?->
How long does it take?
If you command out this routine, will it speed up the time?