![]() |
#1
|
|||
|
|||
![]()
I am using this type of code .I have to delete entire line which contain image of height and width 24.If I skip "Selection.Rows.Delete" this line then it is deleting all shapes in 2 attempts but give run time error. I am new to VBA . So please suggest me how to correct this code
Sub our() Dim iShapeCount As Integer Dim iILShapeCount As Integer Dim DocThis As Document Dim J As Integer Dim K As Integer Dim sTemp1 As Integer Dim sTemp2 As Integer Set DocThis = ActiveDocument iShapeCount = DocThis.Shapes.Count For J = 1 To iShapeCount sTemp1 = DocThis.Shapes(J).Height sTemp2 = DocThis.Shapes(J).Width If sTemp1 = 24 And sTemp2 = 24 Then DocThis.Shapes(J).Delete Selection.Rows.Delete End If Next J iILShapeCount = DocThis.InlineShapes.Count For J = 1 To iILShapeCount sTemp1 = DocThis.InlineShapes(J).Height sTemp2 = DocThis.InlineShapes(J).Width If sTemp1 = 24 And sTemp2 = 24 Then DocThis.InlineShapes(J).Delete Selection.Rows.Delete End If Next J End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
tahakirmani | Word | 2 | 11-28-2013 05:33 PM |
Adapting a line shape | NikkiB | Word | 4 | 03-18-2013 08:45 AM |
Find/Delete inline Page #'s | alderfall | Word | 6 | 11-06-2012 11:51 AM |
How do i get my text in columns straight and inline in word 2007? | terrasaw | Word | 0 | 09-03-2008 06:00 AM |
Delete excel files by code in Access | Barry Richardson | Office | 0 | 06-13-2005 06:26 AM |