Paragraph properties in VBA

L

Lewis Kapell

I have a set of RTF documents which are generated from another source and I
need to manipulate them by VBA. I am already able to do such things as turn
on/off the "page break before" property on paragraphs.

Some of these documents have a few paragraphs that have a defined width and
X/Y location. I want to remove these attributes so that these paragraphs
will flow normally within the document. However I don't see any way to
access these properties via VBA. Am I missing something, or is it just not
possible to do what I am trying to do?

Thanks.
 
D

Doug Robbins - Word MVP

Exactly what do you mean by (particularly the Y) of X/Y location?

If the Normal style has the desired attributes, running a macro containing
the following code will format all of the paragraphs in the document with
that style:

Dim apara As Paragraph
With ActiveDocument
For Each apara In .Range.Paragraphs
apara.Style = "Normal"
Next apara
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
L

Lewis Kapell

You asked what I mean by X/Y location. Well, if I open the RTF document in a
text editor that allows me to see the raw data, I find the following codes
attached to the paragraphs that are improperly positioned (sample):

pvpg\phpg\posx2160\posy9036\absw1790

This appears to be specifying an absolute width and position, which is
consistent with what I see when I open the document in Word.

I will try your suggestion regarding the Normal style. Thanks.
 

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