Searching for a field 
Author Message
 Searching for a field

How can i search for a Field, ie..the below?

ActiveDocument.Fields.Add Range:=myRange, _
     Type:=wdFieldEmpty, _
      Text:="TOC \h \t ""Heading 2,1,Heading 3,2"""



Fri, 04 Mar 2005 20:58:42 GMT  
 Searching for a field
Hi Tim,

Turn on view field codes and place the following in the Find What box of the
Find dialog box:

^d TOC \h \t "Heading 2,1,Heading 3,2"

To find it programmatically, you can use the following:

sTest = "^d TOC \h \t ""Heading 2,1,Heading 3,2"""
Selection.HomeKey unit:=wdStory
With ActiveDocument.ActiveWindow.View
    bFldCode = .ShowFieldCodes
    .ShowFieldCodes = True
    Selection.Find.Execute FindText:=sTest
    .ShowFieldCodes = bFldCode
End With

HTH

Quote:
> How can i search for a Field, ie..the below?

> ActiveDocument.Fields.Add Range:=myRange, _
>      Type:=wdFieldEmpty, _
>       Text:="TOC \h \t ""Heading 2,1,Heading 3,2"""



Fri, 04 Mar 2005 21:37:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How can I search a Memo Field in code

2. Fast search of text field

3. search where a field is used in a database

4. Searching data in fields

5. keyword searching in a field

6. how to search on a field containing single/double quote

7. Search for a Field

8. Use of Find to search a Multi-Field Primary Key

9. SQL - search in multiple fields

10. Searching access date field with sql

11. Creating alarms to search .mdb date fields

12. Searching a Memo field in access 2.0

 

 
Powered by phpBB® Forum Software