Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 04-09-2019, 11:31 PM
modene1 modene1 is offline Mac OS X Office for Mac 2011
Novice
 
Join Date: Jul 2015
Posts: 6
modene1 is on a distinguished road
Smile Wrap Square and Resize Selected Picture


Hi folks,

I'm a novice to VB and, despite extensive searching, can't figure the code to

1) LockAspectRatio = True
2) WrapFormat.Type = wdWrapSquare
3) ShapeHeight = InchesToPoints(0.6)

on the selected picture.

It would save a massive amount of time when inserting images into Word.

Essentially, I'll setup a keystroke to activate the finished code as a macro. ... if that's the best way to do it...?

Thanks!
Reply With Quote
  #2  
Old 04-10-2019, 01:40 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,223
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

Try:
Code:
Sub Demo()
Dim Shp As Shape
With Selection
  If .InlineShapes.Count > 0 Then
    Set Shp = .InlineShapes(1).ConvertToShape
  ElseIf .ShapeRange.Count > 0 Then
    Set Shp = .ShapeRange(1)
  End If
End With
If Not Shp Is Nothing Then
  With Shp
    .LockAspectRatio = True
    .WrapFormat.Type = wdWrapSquare
    .Height = InchesToPoints(0.6)
  End With
End If
Set Shp = Nothing
End Sub
Alternatively, if you're doing bulk insertions, see: http://www.msofficeforums.com/word-v...html#post47919
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Tags
resize pictures, wrap

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing picture wrap text to Square Yonatanx3 Word VBA 2 01-20-2019 03:49 PM
Wrap Text Inside Picture marconexcel Drawing and Graphics 2 02-02-2018 05:01 PM
Wrap TABLES around picture? ShankedS Word Tables 2 11-16-2015 04:27 PM
Word - Resize image to specified selected cells' dimensions FaizanRoshan Word VBA 7 10-18-2015 03:34 PM
Tiny square but no picture pasted Seafarer Word 3 12-28-2011 05:35 PM


All times are GMT -7. The time now is 09:23 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