#1
|
|||
|
|||
How to click on one picture, and another picture will be shown?
Hi all,
I have one idea but I don't know how to make it happen using Word 2007, so I really appreciate if someone can help me! I have a picture of world map. My idea is that if someone clicks on one country in the picture, another picture showing map of that country will be displayed. (e.g.: If I click on France on the world map, the map of France will be shown. The map of France will be hidden until I click on France on the world map) Hope someone can help me! I'm really thankful for that! |
#2
|
||||
|
||||
See attached. Although the demo uses two different-sized pics of the same object, it works equally well with completely different pictures. If you set your main image behind the text and overly it with such fields in the appropriate locations, different images for each country can be produced. You'd probably want to tie each field to a different macro & document property for each country.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
I greatly appreciate for your help. But honestly, I have never tried macro in Word so totally I can follow your instructions. Would you please explain me in more details. I even can't complete your first instruction "Create a custom document property named 'PicSize' as a Yes/No type"
Thanks so much in advance!!! |
#4
|
||||
|
||||
IIRC, you do this via Word > Info > Properties > Advanced properties > Custom.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Thanks for your help! But I'm get stuck at the second step . I followed your instruction at the second step but it doesn't work, maybe because of my limited English ability! Do you mean:
- Create MACROBUTTON field via Ctrl-F9 - Paste "MACROBUTTON PicSize {IF{DOCPROPERTY PicSize}= Y "Pic1 Here" "Pic2 Here"}" between {} - At the position of "Pic1 Here", I will go to Developer tab, and insert "a picture Content Control"; similar for the position of "Pic2 Here" - Then select the field and press F9 I'm really thankful to you! |
#6
|
||||
|
||||
Have you added the macro code to a code module in your document, and the two pictures where indicated in the field code? Look at how it's done in the PicSizer document - including using Alt-F9 to see how the field coding is implemented.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Hi Paul,
i just downloaded and opened the PicSizer document and encountered a problem: PicSizer MacroButton works fine for Word 2003, but it does not for Word 2010. In Word 2010 both click (Options.ButtonFieldClicks = 1) and double-click (Options.ButtonFieldClicks = 2) simply open the 'Picture Tools' tab and completely ignore the MacroButton function. Am I doing sth wrong or is this a Word > 2003 issue. Thanks NP |
#8
|
||||
|
||||
The code works fine for me in both Word 2003 & Word 2010 - with either setting. Evidently you have some other setting (or a fault) that opens the 'Picture Tools' tab when a picture is clicked on.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
It works in Word 2010 when I open the doc file in compatibility mode. As soon as it is saved as docm it stops working.
Any idea? Would be great if it worked ... NP |
#10
|
||||
|
||||
In the docm format, Word does indeed give the images priority over the field, with the result that clicking on them activates the Picture Tools tab. A workaround would be to insert a space either side of the pictures (within the field code) and click on the space instead of the picture.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
Hi,
that's exactly what I did, but it does not really make sense. The effect isn't what it should be and hard to explain to others: "Click in the small space to the right or left of the picture BUT NOT THE PICTURE ITSELF to enlarge or reduce it" sounds quite weird . It's a real pity - could have been such a brilliant solution ... . NP |
#12
|
||||
|
||||
An alternative for Word 2007 & later is to use a picture content control & simply resize that when clicked. The code to do that would be like:
Code:
Private Sub Document_ContentControlOnEnter(ByVal ContentControl As ContentControl) With ContentControl If .Title = "MyPic" Then With .Range.InlineShapes(1) If .Width > CentimetersToPoints(1) Then .Width = CentimetersToPoints(1) Else .Width = CentimetersToPoints(4) End If End With End If End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#13
|
|||
|
|||
Hi Paul,
You're definitely right - I simply did not see the wood for the trees. Thanks for putting me back on track again . NP |
#14
|
|||
|
|||
Quote:
This sounds an interesting idea. Ideally I'm looking for a floating Window, but likely out of luck with Word. Shame, I really have a lot of stuff in Word to publish. Maybe I should look at some sort of interactive electronic book editor, if such a thing exists. Any ideas? I'd like to write interactive content, and don't really want to use macrtos, nor distribute documents with macros due to security issues. |
#15
|
||||
|
||||
What you can do with an electronic book really depends on what interactive functionality your chosen format (e.g. Kindle) gives you. I doubt anything other than Word will support Word macros - and, even then, Word on Macs doesn't support content controls.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Move Picture by picture name, rename picture by picture name | CatMan | PowerPoint | 2 | 04-18-2012 12:21 PM |
Right-click has Edit Picture greyed out | Nick.Ryan | Drawing and Graphics | 1 | 02-15-2012 09:40 PM |
Powerpoint automatically changing picture size when adding a picture (2010) | One_Life | PowerPoint | 7 | 01-20-2012 06:57 AM |
Right-click on a picture in Word | munchoa | Word VBA | 1 | 10-01-2011 10:03 AM |
"format picture" - arrows show as no line atop picture | marbeth | Word | 3 | 07-08-2011 02:16 PM |