Can't Re-set Cross-Reference Dialog Box

V

Vivian Carroll

Word 2002:

When I insert a cross-reference for a bookmark, I am
unable to programically get the cross-ref dialog box to
change from bookmark to numbered item. Whatever entry is
previously done manually by the user (e.g. bookmark), stays in the cross-
ref dialog box until manually changed to something else.

My goal is to have the cross-reference dialog box open defaulting to
"Numbered Item" and "Paragraph Number" and then have the user select which
paragraph to reference.

This is my code:

With Dialogs(wdDialogInsertCrossReference)
.ReferenceType = wdRefTypeNumberedItem
.ReferenceKind = wdNumberFullContext
.InsertAsHyperlink = True
.InsertPosition = False
If .Display = -1 Then
.Execute
Else
Exit Sub
End If
End With

TIA, Vivian
 
D

Doug Robbins

Hi Vivian,

I think you might have to resort to the use of SendKeys

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
V

Vivian Carroll

Thank you Doug - it works!

Here's the code I came up with.

With Dialogs(wdDialogInsertCrossReference)
'Cursor is in Reference Type box, select Numbered Item
SendKeys "n"
'Move to Reference Kind box, type "p" for "Page Number"
'then move down one item in the list to Paragraph Number
'then press Enter to select Paragraph Number
SendKeys "{TAB}""P""{DOWN}""{ENTER}"
'Move to Insert As Hyperlink, check it by typing hot key "h"
SendKeys "{TAB}""h"
.Display
End With

Vivian
 

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