View Single Post
 
Old 01-28-2015, 04:41 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

A Document_ContentControlOnEntry macro might be coded as:
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
and assumes your picture content control's Title = "MyPic". The code would be added to the document's 'ThisDocument' code module. The above is a trivial demo that just changes the image's width back & forth from 1 to 4 cm.

I don't agree that "Word makes assigning and using macros so much harder than Excel". It's not harder, just different in some respects.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote