Delet paragraph if the alignement is diffrent

F

filo666

Hi have a document with 900 pages; what I need to do is to eliminate al the
paragraphs that haVE an allignement different than 3 cm from left to right, I
have 3 cm, 4 cm and 5 cm, and the information of the 4 and 5 cm is not
usefull for me; could someone send me the code so to accomplish this.

TIA
 
H

Helmut Weber

Hi Filo,

there may occur problems with converting
centimeters to points or vice versa.

Here with a US-Version of windows and office,
and some regional setting german,

this one is working here and now:

Sub Test567()
Dim oPrg As Paragraph
For Each oPrg In ActiveDocument.Paragraphs
If oPrg.LeftIndent <> 85.05 Then ' 85.05 points
oPrg.Range.Delete
End If
Next
End Sub

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top