Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-04-2012, 12:46 PM
remodel remodel is offline Picture to not modify table Windows 7 64bit Picture to not modify table Office 2007
Novice
Picture to not modify table
 
Join Date: Oct 2012
Posts: 2
remodel is on a distinguished road
Default Picture to not modify table

I have created a table within Microsoft Word 2007 to hold photographs as a secondary user document. I will be leaving the photograph control blank to be modified with insertion by the using party. What I need to accomplish is "locking" the photograph and/or table so that when the user clicks on the pane in the table that they wish to use the control for the photograph, they cannot rotate, resize, move, etc. the photograph.
I still require the user to be able to modify Rich Text boxes throughout the document to "rename" the photographs they are inserting.
Thank you in advance for any assistance you may be able to provide.



Brandon
Reply With Quote
  #2  
Old 10-05-2012, 09:59 AM
macropod's Avatar
macropod macropod is offline Picture to not modify table Windows 7 64bit Picture to not modify table Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Hi Brandon,

If you:
• use a table with fixed row heights and column widths;
• apply editing restrictions
a ContentControlOnExit macro can be used to limit what users can do with the inserted pictures.

For installation instructions, see: http://www.gmayor.com/installing_macro.htm
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Application.ScreenUpdating = False
Dim iShp As InlineShape, TblCell As Cell, StrPwd As String, Prot
StrPwd = "" 'password
With ActiveDocument
  Prot = .ProtectionType
  If Prot <> wdNoProtection Then .Unprotect StrPwd
End With
With ContentControl
  If .Type = wdContentControlPicture And .Range.Information(wdWithInTable) Then
    With .Range
      Set TblCell = .Cells(1)
      If .ShapeRange.Count > 0 Then
        With .ShapeRange(1)
          .LockAspectRatio = msoTrue
          .Width = TblCell.Width
          If .Height > TblCell.Height Then .Height = TblCell.Height
        End With
        GoTo ShpExit
      End If
      Set iShp = TblCell.Range.InlineShapes(1)
      iShp.LockAspectRatio = msoTrue
      iShp.Width = TblCell.Width
      If iShp.Height > TblCell.Height Then iShp.Height = TblCell.Height
      .ParagraphFormat.LeftIndent = TblCell.LeftPadding * -1
    End With
  End If
End With
ShpExit:
If Prot <> wdNoProtection Then
  ActiveDocument.Protect Type:=Prot, NoReset:=True, Password:=StrPwd
End If
Application.ScreenUpdating = True
End Sub
If your document has the editing restrictions password-protected, you'll need to add the password between the double-quotes in StrPwd = "".

Now for some caveats:
Even if you use a ContentControlOnExit macro, the user can still rotate the picture, but they could do that outside Word, anyway. More importantly, if
• Word’s picture insertion mode (File|Options|Advanced>Cut,Copy,Paste) is other than in-line; and
• the user uses the Insert|Picture dialogue (which is not disabled when editing restrictions are applied) to insert the picture instead of doing so by double-clicking on the Content Control,
the user can drag the picture to wherever they want, provided it's top is lower than the top of the cell concerned. When they do, the picture will still snap back to within the cell's horizontal alignment, but it ignores the vertical alignment altogether and there seems to be no way to correct it in code – I’ve tried all manner of adjustments to the .Top value and .RelativeVerticalPosition settings and the picture sullenly remains wherever it was dragged to – even below the table.

See attached file.
Attached Files
File Type: zip PictureCCtrl.zip (38.5 KB, 13 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
image insert, restrictions, table control

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
Powerpoint automatically changing picture size when adding a picture (2010) One_Life PowerPoint 7 01-20-2012 06:57 AM
How to modify the citation format MREGLIER Word 0 02-19-2011 03:31 AM
Disable/Modify MOC.exe worthydaydream Office 3 04-23-2010 10:43 AM
Picture to not modify table Modify an AppointmentItem in someone else's Calendar humpra Outlook 1 10-16-2009 03:35 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft