Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2007

Tip: Looking for answers? Try searching our database.

Default formatting for pictures

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sandi Vogel - 09 Mar 2007 21:41 GMT
I am sick to death of pasting a screen shot into a Word document,
right-clicking on it, selecting format picture, change the size to 3" and
aligning it tight to the right.  Does anyone have code for applying these
changes to the currently selected picture?  Thanks in advance! -- Sandi
Lene Fredborg - 10 Mar 2007 00:27 GMT
The macro below may do what you want. It sets the wrapping style of the
selected shape to Tight and the Horizontal alignment to Right - both the
width and height of the shape are set to 3". The shape will be positioned
relative to the margin.

Note:
1. If the wrapping style of the selected shape is "In line with text" when
pasted, you must insert the following code line _before_ the line "Set oShape
=…":

Selection.InlineShapes(1).ConvertToShape

2. If you want to set only the width to 3" and scale the shape
proportionally, change “msoFalse” to “msoTrue” in the line : “
LockAspectRatio = msoFalse” (the “:Height =…” line is without importance
then).

The macro:

Sub ResizeAndPositionScreenDump()

   Dim oShape As Shape
   
   Set oShape = Selection.ShapeRange(1)
   With oShape
       ‘Change msoFalse to msoTrue to scale proportionally
       .LockAspectRatio = msoFalse
       .Width = InchesToPoints(3)
       .Height = InchesToPoints(3)
       .RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
       .Left = wdShapeRight
       .WrapFormat.Type = wdWrapTight
   End With

End Sub

Signature

Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word

> I am sick to death of pasting a screen shot into a Word document,
> right-clicking on it, selecting format picture, change the size to 3" and
> aligning it tight to the right.  Does anyone have code for applying these
> changes to the currently selected picture?  Thanks in advance! -- Sandi
Sandi Vogel - 12 Mar 2007 14:27 GMT
Works like a charm!  Thanks so muchl

> The macro below may do what you want. It sets the wrapping style of the
> selected shape to Tight and the Horizontal alignment to Right - both the
[quoted text clipped - 36 lines]
> > aligning it tight to the right.  Does anyone have code for applying these
> > changes to the currently selected picture?  Thanks in advance! -- Sandi
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.