PDA

View Full Version : Solved: wdDialogInsertHyperlink



chrismc
02-02-2011, 01:59 PM
Hi folks,

I want to display and prepopulate the Insert Hyperlink dialog but I can't find any references to the arguments that the dialog uses. Can anyone point me in the right direction for tracking the information down.

I can use Dialogs(wdDialogInsertHyperlink).Show to display the dialog but that's as far as I have got so far.

Thanks in advance.

Chris

macropod
02-02-2011, 02:35 PM
Hi Chris,

Because the dialog's fields aren't directly accessible to the vbe, you need to use SendKeys. For example:
Sub Demo()
With Dialogs(wdDialogInsertHyperlink)
SendKeys "%e"
SendKeys "Hyperlink Path"
SendKeys "%t"
SendKeys "Text to Display"
.Show
End With
End Sub

chrismc
02-02-2011, 02:47 PM
Hi Chris,

Because the dialog's fields aren't directly accessible to the vbe, you need to use SendKeys. For example:
Sub Demo()
With Dialogs(wdDialogInsertHyperlink)
SendKeys "%e"
SendKeys "Hyperlink Path"
SendKeys "%t"
SendKeys "Text to Display"
.Show
End With
End Sub

Thanks for the quick reply. I'm not a fan of SendKeys but I'll try this out.