Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-20-2020, 04:50 PM
gmaxey gmaxey is offline Formatting picture Windows 10 Formatting picture Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,636
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Step through this version of your original code. It won't hang because the inlineshape is no longer selected:




Code:
Sub Whine1()
Dim oILS As InlineShape
  With Selection
    If .InlineShapes.Count <> 1 Then Exit Sub
    Set oILS = .InlineShapes(1)
    .Collapse wdCollapseEnd
  End With
  With oILS.Borders
    .Enable = True
    .OutsideLineWidth = wdLineWidth300pt
    .OutsideLineStyle = wdLineStyleSingle
    .OutsideColorIndex = wdBlack
  End With
End Sub

and this, it will format all the inlineshapes and shapes in the main text storyrange of the document.


Code:
Sub WhineII()
Dim oILS As InlineShape
Dim oShp As Shape

  For Each oILS In ActiveDocument.InlineShapes
    With oILS.Borders
      .Enable = True
      .OutsideLineWidth = wdLineWidth300pt
      .OutsideLineStyle = wdLineStyleSingle
      .OutsideColorIndex = wdBlack
    End With
  Next oILS
  For Each oShp In ActiveDocument.Shapes
    With oShp
       .Line.ForeColor.RGB = RGB(0, 0, 0)
       .Line.Weight = 4
       .Line.DashStyle = msoLineSolid
    End With
  Next
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #2  
Old 11-20-2020, 11:20 PM
ksor ksor is offline Formatting picture Windows 10 Formatting picture Office 2016
Advanced Beginner
Formatting picture
 
Join Date: Feb 2018
Location: Århus V, Denmark
Posts: 78
ksor is on a distinguished road
Default

Grumbling


You should just read my original Q:


"How can I change it to work on "flowting pictures too ?"


and now you did ... and TOO made an exelent solution - THX !
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting picture Inserting and formatting a picture BLUEPUPIL Word VBA 2 04-28-2019 03:14 PM
Formatting picture Picture formatting. voyagerone Drawing and Graphics 3 05-31-2016 09:55 PM
Picture Formatting Problem thowes2 Word 1 04-24-2013 05:24 PM
Formatting picture Picture Formatting Issues mayj Word 1 04-02-2013 03:09 AM
Formatting picture insert object or picture, strange formatting layout qwertyjjj Word 5 01-10-2013 09:49 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:22 PM.


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