Return value for wdDialogInsertHyperlink show

  • Thread starter Victor Boris Arnold
  • Start date
V

Victor Boris Arnold

Word 2000 SP-3.

I am using the following statement to display the Insert
Hyperlink built-in dialog box and insert the link into the
document. That part works, but according to the VBA help,
the return value of this method should be -1 if the OK
button was used, 0 if the Cancel button was used, or -2 if
the Close button was used. However, no matter what button
I use in the dialog box, the return value is always -1.


If Dialogs(wdDialogInsertHyperlink).Show <> -1 Then
.....do stuff here....
End If
 
D

Doug Robbins - Word MVP

Use the following type of construction:

With Dialogs(wdDialogFileOpen)
If .Display Then
'file was selected
MsgBox .Name
Else
MsgBox "Dialog cancelled
End If
End With


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
V

Victor Boris Arnold

I'm certainly willing to try this, but my VBA help shows
that there are no arguments for wdDialogInsertHyperlink.
Are any items like the ".Name" in your example available
for the particular built-in dialog box I want to use?

And why doesn't the return code logic I am trying to use
work? Is this a characteristic that is particular to the
specific dialog box I'm using?
 
D

Doug Robbins - Word MVP

That was just an example. You do not need to use the MsgBox statement.
Replace it with your .....do stuff here.... routine

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
V

Victor Boris Arnold

Unfortunately, the OK button, the Cancel button, and the
Close (X) button all return -1 for this particular built-
in dialog.
 

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