Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

assing macro to an an image, shape, text in Word 2007

395 views
Skip to first unread message

Lev

unread,
Apr 9, 2010, 12:45:01 PM4/9/10
to

I would like to run one of my macros when either an image, or a shape, or a
text is clicked in Word 2007 document.
Thanks,

Fumei2 via OfficeKB.com

unread,
Apr 9, 2010, 1:10:46 PM4/9/10
to

Use an ActiveX control, as they have a _Click event.

--
Gerry

Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/201004/1

Jay Freedman

unread,
Apr 9, 2010, 1:48:07 PM4/9/10
to
Another method is to insert a MacroButton field and paste the image into the
field code where the display text would be. See
http://www.word.mvps.org/FAQs/TblsFldsFms/UsingMacroButton.htm, and the
"Double-click or single-click" section of
http://www.word.mvps.org/FAQs/TblsFldsFms/HLinksInForms.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Steve Schultz

unread,
Jul 7, 2011, 2:21:48 PM7/7/11
to
In Word 2007 I have assigned a .JPG to a macrobutton in a .DOTM file like this:

{MACROBUTTON macroname .JPGimage}

This works fine in Word 2003, but in Word 2007 .DOTM file, double clicking on the image file does not work and the image is selected while the PICTURE TOOLS/FORMAT ribbon is displayed at the top of the screen. For some reason, the image file is not associated with the MACROBUTTON and macroname.

Any clue why this is not working in a Word 2007 .DOTM file?

Thanks,
Steve Schultz

> On Friday, April 09, 2010 12:45 PM Lev wrote:

> I would like to run one of my macros when either an image, or a shape, or a
> text is clicked in Word 2007 document.
> Thanks,


>> On Friday, April 09, 2010 1:48 PM Jay Freedman wrote:

>> Another method is to insert a MacroButton field and paste the image into the
>> field code where the display text would be. See
>> http://www.word.mvps.org/FAQs/TblsFldsFms/UsingMacroButton.htm, and the
>> "Double-click or single-click" section of
>> http://www.word.mvps.org/FAQs/TblsFldsFms/HLinksInForms.htm.
>>
>> --
>> Regards,
>> Jay Freedman
>> Microsoft Word MVP FAQ: http://word.mvps.org
>> Email cannot be acknowledged; please post all follow-ups to the newsgroup so
>> all may benefit.
>>
>> Fumei2 via OfficeKB.com wrote:


>>> On Friday, April 09, 2010 5:10 PM Fumei2 via OfficeKB.com wrote:

>>> Use an ActiveX control, as they have a _Click event.
>>>
>>> Lev wrote:
>>>

Jay Freedman

unread,
Jul 7, 2011, 9:51:49 PM7/7/11
to
You're correct. I hadn't gotten around to testing this in Word 2007, but it is
as you say. I suspect this is a side effect of the changes made in the program
code to make the context-sensitive tabs of the ribbon such as the Picture
Tools tab appear when needed. The behavior is the same in Word 2010.

It looks like the only way to get the picture-in-macrobutton function back in
Word 2007 or 2010 is to save the template in Word 97-2003 (*.dot) format or,
alternatively, to save each document based on the .dotm template as a Word
97-2003 (*.doc) document. Of course, that means you can't save anything in the
file that uses new features of the later versions (e.g., Smart Art), but
whether that's important is up to you.

0 new messages