Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

run macro when user clicks on link

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bugzpodder - 30 Jan 2006 19:05 GMT
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
bugzpodder - 30 Jan 2006 22:07 GMT
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

> 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
[quoted text clipped - 11 lines]
> Thanks,
> Jack

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.