Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Drawing and Graphics

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 05-09-2012, 03:39 AM
unsvn unsvn is offline Windows XP Office 2007
Novice
 
Join Date: May 2012
Posts: 3
unsvn is on a distinguished road
Default 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!
Reply With Quote
  #2  
Old 05-10-2012, 12:54 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,199
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

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.
Attached Files
File Type: zip PicSizer.zip (112.0 KB, 86 views)
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 05-10-2012, 06:48 AM
unsvn unsvn is offline Windows XP Office 2007
Novice
 
Join Date: May 2012
Posts: 3
unsvn is on a distinguished road
Default

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!!!
Reply With Quote
  #4  
Old 05-10-2012, 06:59 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,199
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Quote:
Originally Posted by unsvn View Post
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"
IIRC, you do this via Word > Info > Properties > Advanced properties > Custom.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 05-12-2012, 10:10 PM
unsvn unsvn is offline Windows XP Office 2007
Novice
 
Join Date: May 2012
Posts: 3
unsvn is on a distinguished road
Default

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!
Reply With Quote
  #6  
Old 05-12-2012, 10:13 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,199
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

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
[MS MVP - Word]
Reply With Quote
  #7  
Old 12-05-2014, 05:58 AM
NobodysPerfect NobodysPerfect is offline Windows 8 Office 2010 32bit
Competent Performer
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

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
Reply With Quote
  #8  
Old 12-05-2014, 12:29 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,199
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

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
[MS MVP - Word]
Reply With Quote
  #9  
Old 12-05-2014, 12:54 PM
NobodysPerfect NobodysPerfect is offline Windows 8 Office 2010 32bit
Competent Performer
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

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
Reply With Quote
  #10  
Old 12-05-2014, 01:33 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,199
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

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
[MS MVP - Word]
Reply With Quote
  #11  
Old 12-05-2014, 01:58 PM
NobodysPerfect NobodysPerfect is offline Windows 8 Office 2010 32bit
Competent Performer
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

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
Reply With Quote
  #12  
Old 12-05-2014, 02:15 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,199
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

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
Much simpler than using MACROBUTTON fields, as is required for Word 2003 & earlier.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #13  
Old 12-05-2014, 02:30 PM
NobodysPerfect NobodysPerfect is offline Windows 8 Office 2010 32bit
Competent Performer
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default

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
Reply With Quote
  #14  
Old 10-20-2015, 10:24 PM
eXellent Solutions eXellent Solutions is offline Windows 10 Office 2013
Novice
 
Join Date: Oct 2015
Location: Pacific Rim
Posts: 2
eXellent Solutions is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
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
Much simpler than using MACROBUTTON fields, as is required for Word 2003 & earlier.
Hi,
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.
Reply With Quote
  #15  
Old 10-20-2015, 10:37 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,199
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

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
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


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


All times are GMT -7. The time now is 11:13 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft