onclick events

V

vera

Can someone point me in the right direction, please? Is it
possible to add events to the objects placed in a word
document? This is the behavior I want in the document. I
want to click on an icon and display a picture, I'm
thinking that terminology is collapse maybe? Then I want
to click on the picture and have it not display. I haven't
the foggiest idea where to start with this...

Vera
 
K

Klaus Linke

Hi Vera,

I'm not too sure what you're exactly trying to do. It sounds like a simple
hyperlink.

You could insert some simple icon (or WordArt...), right-click, and make it
a "Hyperlink..." to some graphics file.
If you follow the hyperlink (Ctrl+click in Word2002/2003), the graphics file
opens.

Or you might check out macrobutton fields:
{ MACROBUTTON <insert_your_icon_here> Show_Pic }

Double-clicking the icon would start the macro "Sub Show_Pic()", which in
turn could start a graphics program like "MSPaint" with the picture you
want.
Look at the Shell command for how to do this; something like

Sub Show_Pic()
Dim strPicturePath As String
strPicturePath = """C:\myPicture.JPG"""
Shell PathName:="MSPaint.exe " _
& strPicturePath, WindowStyle:=vbMaximizedFocus
End Sub
Then I want to click on the picture and have it not display.

In both the methods above, you'd have to close the graphics program to
continue working in Word.

Greetings,
Klaus
 
V

vera

Klaus,

After a little looking around this afternoon, I think I
can do what I want by adding an onclick event to an
activex image object. Not sure yet, have to prototype.

The next question I have, and I'm going to post this as a
new thread is:

I'm creating a Word document in VB6. I'm pretty sure that
I can add the forms ActiveX components to the Word
document. Is there any way to add a code module or the
event code for these components to the Word document from
VB6? I can't seem to find a module object and I'm thinking
maybe the modules aren't really associated with the
document, but with the document's project? Am I correct?
Am I confused? Please help, I'm just really new at this
Word VBA thing.

Vera
-----Original Message-----
Hi Vera,

I'm not too sure what you're exactly trying to do. It sounds like a simple
hyperlink.

You could insert some simple icon (or WordArt...), right- click, and make it
a "Hyperlink..." to some graphics file.
If you follow the hyperlink (Ctrl+click in
Word2002/2003), the graphics file
 

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