Exclude hidden appendix from search range in vba

J

jlashley

Hello,
In a word 2003 documend, is there a way to exclude from a search range
(vba) the hidden appendix used for the browser ? when I use the
search module from Doug & Helmut, I've got results inside this hidden
part but I need only to search in the "visible" part of the file..

Any way to do this ??

Many thanks in adabce

JL
 
D

Doug Robbins - Word MVP

You could probably use code to check whether the selection is in that
section of the document and have it skip whatever you are doing if it is.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

jlashley

Ok.
as I'm new in word VBA, I thought it was a property or mefhod for this
part of document.
Thanks
 
R

Russ

Are you using the Word interface to collapse parts of the document from view
according to style format hierarchy?
That interface doesn't hide the text from the 'find and replace' functions.

It doesn't, for example, give the unseen text the property of:
selection.font.hidden = True
 
D

Doug Robbins - Word MVP

What do you want to do if the text is found other than in the appendix?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

jlashley

Hello,
I want to copy the text only behind the search string, but only if
it's in the "visible" part of the document .
The probem is that in some document, the search string may be in the
hidden and not in the "visible" part, so the idea to test the
section's numbers is fine; In this this cas I nothing do
(In fact, this hiddden appendix is the XML flow)
 
J

jlashley

Hello,
I'm sorry, but I can't reply : before to work on such document, I
never seen this feature : when I click on the stat of this "hdden
appendix", corresponding to xml flux, automatically I go to the first
page of the document...
For example for 9 real pages ( I can print...) , whith this "hidden
appendix", Word count 41 pages..

Regards
 
D

Doug Robbins - Word MVP

Well, I am not sure that it is applicable to your situation, which I do not
understand, but what I was thinking was to include an If ... then ...End If
construction that checked whether the font of found text was formatted as
Hidden.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
R

Russ

Jlashley,
You must be opening a WordML file in such a way to see the XML code in
Word2003.
Try opening the file as a regular Word document in the open file dialog box
(as a regular .doc file?) so that you don't see the XML code used for
formatting. Then you can use the Find and Replace on the real, visible part
of the document.
I have no experience with the XML capabilities of Word, since the versions I
normally use don't have that feature.
 

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