run macro when user clicks on link

B

bugzpodder

Hi. I want some sort of hyperlink effect with macros. That is, when a user
clicks on a hyperlink, i want instead a macro to run and have the macro know
which link is clicked (so I could activate a third-party COM DLL). So
basically i want to handle an onclick event with macros. I manged to do
this in powerpoint because there exists an "Action Settings..." But how do I
do this in Word? (and perhaps other office programs)

This is the simple macro I had working in powerpoint:

Sub test(myShape As Shape)
MsgBox myShape.AlternativeText
End Sub

Thanks,
Jack
 
B

bugzpodder

Okay, I've manged to figure out how to use macro-buttons and the control
toolbox. It is flexible enough for me to do what I want. However, something
else isn't working (related). When I add the VBA code to call the DLL to one
of these things, I get "Run-time error '-2147024894 (80070002)': File or
assembly name xxxxx, or one of its dependencies, was not found."

If it makes any difference, my dll file is xxxxxx.dll while the error
message just mentions xxxxxx (I googled this msg up, and it seems to have
included the dll extension). What I know is I used the exact same code and
functionality in powerpoint (by mimicing the button in the control toolbox)
and it works awsomely fine, but it just doesnt work in word! my (C#) COM dll
is regasm'ed and gacutil'ed and according to VB Editor->Tool->Reference a
checkmark is beside my DLL (in both word and powerpoint) but it just work in
ppt and not in word!! How come??

Thanks,
Jack
 

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