Get all cross references in word with VBA -
I have many cross references to handling a very large word document (& gt; 400 pages) So far, I always The title is referenced in the title, but now I would like to change it and look at the page that remains on top.
I did not get the solution for this GUI (except for manual treatment, of course), so I was trying to write some VBAs. Unfortunately, I've found a way to list only those goals that can be cross-referenced (via Can you help me with that? Is a cross reference field similar to a hyperlink? Cross-references are fields in a Word document, and through field archive (ActiveDocument.Fields) Can be reached. You can loop through them like any other collection and check your type if you want to work on it. It seems that cross-references in the context of the text are type 3 (wdFieldRef) and cross-reference type 37 (wdFieldPageRef) of page numbers. Changing the field can be a bit difficult; The following should start with you: GetCrossReferenceItems ), but I want a way to reach the actual cross reference field .
Sub-changefield () Dimensional document like dim ozdoc, dim dose obzfold field as long as the field DFISTTRSR, set as long as LFLStart ObjDoc = ActiveDocument 'Loop ObjDoc.Fields in ActiveDocument for each objFld' If the area is a cross-referee, do something for it if objFld.Type = wdFieldRef then make sure that the code of the field appears in the Mac Running row before you can toggle it manually. ObjFld.ShowCodes = True 'I hate to use selection here, but this is probably the most direct way to do this. Select the field, find your start and then move the cursor over so that it is correct before 'r' in the REF. Objfld.Select Selection.Collapse wdCollapseStart Selection.MoveStart 'R' type 'Page' until '' PEGEREF '' to turn on REF. This one page changes a text reference in reference context. Selection. Update the type of text "page" field so that the changes appear in the document. ObjFld.Update objFld.ShowCodes = True End if the next objFld End sub
Comments
Post a Comment