Hi Macropod,
Yes, this code works, and the only thing I had to change was the .end setting. I needed 7 characters after the string, so that I could pick up some stuff after it, if it existed. However, this causes a slight problem if you have two matching strings which may be on the same line...
Hi Macropod,
I apologize for not using code tags. I'm blind (hence the handle), and didn't spot the "Code" tag there. Now I'm aware of it, I'll use it. As to the code, I'll probably use an if statement so that only footnotes and maintext are processed. About to try it.
Best, PID.
Hi Macropod,
Here is the code:
For intRangeSelect = 1 To 2
If intRangeSelect = 1 Then
ActiveDocument.StoryRanges(wdMainTextStory).Select
Else
ActiveDocument.StoryRanges(wdFootnotesStory).Select
End If
With Selection.Find
.ClearFormatting
.Text = strFindText
.Replacement.Text = ""
.Forward = True...
Hi again Macropod et al,
Everything works fine now but...
The macro searches the main document with no problem, but I've got a loop so that once it has searched the main document, the selection is set to the Footnotes range. Having inserted this code, it gets into a loop. Having stuck some...
Hi again,
At the risk of becoming boring, there seems to be a problem with the way I'm referring to things in this macro.
Consider the following:
set myrange=activedocument.storyranges(wdmaintextstory)
Do While blnFound = True
myRange.Find.ClearFormatting
With myRange.Find
.Text = strFindText...
Hi again,
The importxml method is probably the way I'd go, but if you are using office 2003 or higher, there already exist tools that will help you, and take most of the donkey work out of the project. go to...
Hi, You'll need to look in the vba help at the ImportXML method. Having done that, you'll need to look at the xmlmap object, and make sure that you have your schema set correctly. Once you've done that, the whole process should be fairly straightforward. As to the refresh button, you just need...
Thanks very much for this very helpful post. It has opened a tiny door in my memory, and I'm in the process of implementing (with some small changes) the offered code.
Hello, I hope someone out there can help, as this particular problem is driving me mad. I've been asked to write a customized index builder for ms word 2003. The words I'm having to look for are contained in an array, and I use the Find command to look through the document. All was fine, until I...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.