Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-02-2016, 05:27 AM
PRA007's Avatar
PRA007 PRA007 is offline Working with Ishapes Windows 7 64bit Working with Ishapes Office 2010 32bit
Competent Performer
Working with Ishapes
 
Join Date: Dec 2014
Location: Ahmedabad, Gujrat, India
Posts: 145
PRA007 is on a distinguished road
Default Working with Ishapes

Why this code fails:



Code:
Sub demo()
'works fine
Application.ScreenUpdating = False
Dim iShp As InlineShape
For Each iShp In ActiveDocument.InlineShapes
  With iShp.Range
            If iShp.Height > 6 Then
              iShp.LockAspectRatio = True
              iShp.Height = InchesToPoints(6)
                  If .Hyperlinks.Count = 1 Then
                    .Hyperlinks(1).Delete
                  End If
            End If
            If iShp.Width > 4 Then
              iShp.LockAspectRatio = True
              iShp.Width = InchesToPoints(4)
              If .Hyperlinks.Count = 1 Then
                  .Hyperlinks(1).Delete
              End If
            End If
  End With
Next
Application.ScreenUpdating = False
End Sub
I want to resize images in the document based on the logic that

1) if the hight of the shape is > 6, make it to 6.

2) if the width of the shape is > 4, make it to 4.

In above code irrespective of size of the shape it executes the code.
Reply With Quote
Reply

Tags
word vba

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with Ishapes TOC Not Working Gary91 Word 3 01-21-2015 05:52 AM
vlookup not working jolinchew Excel 3 08-10-2013 05:24 PM
Working with Ishapes working 4 10's, need help to set up rkirkland Project 1 12-19-2012 02:47 PM
Working with Ishapes Go To Slide while working. excelledsoftware PowerPoint 3 02-22-2012 12:41 PM
GIF's stop working Kwarior PowerPoint 3 03-17-2010 09:59 PM

Other Forums: Access Forums

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