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 / September 2007

Tip: Looking for answers? Try searching our database.

macro to increase picture to 100%

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
potternm - 08 Sep 2007 21:13 GMT
My group constantly copies vector art and pastes in as either Windows
Metafile or Enhanced Metafile, whichever is best for that case. But then we
need to make them 100%.

Is there any way to put the 100% in a macro?  I've tried recording one, but
it always comes up with pixel measurements rather than percentages, so it
doesn't work for others. I have a macro (copied) to place inline with text as
Enhanced Metafile but nothing about changing the size.

Sub PasteAsMetafile()
Selection.PasteSpecial DataType:=wdPasteMetafilePicture, Placement:=wdInLine
'Selection.PasteSpecial DataType:=wdPasteEnhancedMetafile, Placement:
=wdInLine
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.InlineShapes(1).LockAspectRatio = msoTrue
End Sub

Wish I could write a macro, but have no experience. thanks for any help you
can provide.

Potternm
Shauna Kelly - 09 Sep 2007 22:56 GMT
Hi potternm

Something like this should do it. This acts on both inline shapes and
floating shapes.

Sub MakeShape100Percent()

Dim oILS As Word.InlineShape
Dim oShape As Word.Shape

   On Error Resume Next
   Set oILS = Selection.InlineShapes(1)
   Set oShape = Selection.ShapeRange(1)

   On Error GoTo 0
   If Not oILS Is Nothing Then
       With oILS
           .ScaleWidth = 100
           .ScaleHeight = 100
       End With
   ElseIf Not oShape Is Nothing Then
           With oShape
               .ScaleHeight Factor:=1, RelativeToOriginalSize:=True
               .ScaleWidth Factor:=1, RelativeToOriginalSize:=True
           End With
   Else
       MsgBox "Please click on an image or object and try again"
   End If

End Sub

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> My group constantly copies vector art and pastes in as either Windows
> Metafile or Enhanced Metafile, whichever is best for that case. But then
[quoted text clipped - 22 lines]
>
> Potternm
potternm - 10 Sep 2007 21:28 GMT
Thanks a lot. It works great. But we only work with inline, because
everything has to have a caption and we use frames if we want to wrap text
around it. Is there anyway I can make both macros one? Or have the original
call on yours?  I want to get down to one keystroke/mouseclick if I can since
I've got arthritis in my fingers.  

>Hi potternm
>
[quoted text clipped - 37 lines]
>>
>> Potternm
 
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.