Problem with Indentations

S

sorcerer

Hi Guys.
Is there a way to find out the current indentation of any paragraphs
such that I get the indentation as the answer.
Please tell me
 
S

Stefan Blom

Investigate the values of the LeftIndent, RightIndent and
FirstLineIndent properties. For example, the following macro would
print to the Immediate Window of the Visual Basic Editor the values
(in points) of left, right, and first line indents for the first
paragraph contained in the selection:

Sub PrintIndents()
With Selection.Paragraphs(1)
Debug.Print .LeftIndent
Debug.Print .RightIndent
Debug.Print .FirstLineIndent
End With
End Sub
 
S

sorcerer

Hi Guys
Hey what is the relation between,
left indent, tabhanging indent and firstline indent.
I have a document with some random haphazard indentation.
If I give a leftindent of 0.79 to the list paragraphs for example,
it actually does not give a left indent of 0.79. It gives me some other
indent.
So What is the relation between the three attributes and How do I get
it to do my job.
 
J

Jonathan West

sorcerer said:
Hi Guys
Hey what is the relation between,
left indent, tabhanging indent and firstline indent.
I have a document with some random haphazard indentation.
If I give a leftindent of 0.79 to the list paragraphs for example,
it actually does not give a left indent of 0.79. It gives me some other
indent.
So What is the relation between the three attributes and How do I get
it to do my job.

This text has a left indent. This text has a left indent.
This text has a left indent. This text has a left indent.
This text has a left indent. This text has a left indent.

This text has a hanging indent. This text has a hanging indent.
This text has a hanging indent. This text has a hanging indent.
This text has a hanging indent. This text has a hanging indent.

This text has a first line indent. This text has a first line indent. This
text has a first line indent. This text has a first line indent. This text
has a first line indent.


The LeftIndent property gives you the indentation of the paragraph as a
whole (in points).

The FirstLineIndent property defines the modification to the indentation of
the first line of the paragraph. If you set a hanging indent using the
Format Paragraph dialog, then the value of FirstLineIndent is negative. For
a first line indent, the value is positive.

If you have a 1/2" indent of various kinds, the values of the properties are
as follows

Indent type LeftIndent property FirstLineIndent property
1/2" left 36 0
1/2" first line 0 36
1/2" hanging 36 -36


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
S

sorcerer

Hi Jonathan
Does this logic apply to bulleted, numbered and outline numbered
paragraphs too.
Cause I am having a problem only with those kind of paragraphs and not
with body text.
 
J

Jonathan West

sorcerer said:
Hi Jonathan
Does this logic apply to bulleted, numbered and outline numbered
paragraphs too.
Cause I am having a problem only with those kind of paragraphs and not
with body text.

Ah, you might have mentioned that a little earlier!

With bullets and numbering it is different. In fact if you are manually
applying bullets and numbering from the Format, Bullets and Numbering
dialog, than you are in for all kinds of problems if you are copying &
pasting and trying to create a lengthy document. We call this problem
"spaghetti numbering", and it is a well-known design fault in Word.

The issue is too complex to describe in a short newsgroup reply, so instead,
I recommend that you read the following two articles.

Word's numbering explained
http://www.word.mvps.org/FAQs/Numbering/WordsNumberingExplained.htm

How to restart style-based numbering
http://word.mvps.org/FAQs/Numbering/ListRestartMethods.htm

Once you have read through those, you will hopefully realise that for a
document of any length or complexity that uses numbering, you *must* define
a template, it *must* have an appropriate set of styles for it, and
numbering *must only ever* be inserted by applying the appropriate styles.
Any other approach is asking fro trouble.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
S

sorcerer

Yes, the docs in that place are good.
Hey one more query john.
I am not applying the headings and numbering manually.
I already have a document with random headers, numbered lists etc, etc.
Then I have to write a macro that identifies everything and gives
different
indentations for the headings, numbered lists and bulleted lists. Hows
that man.
 
S

sorcerer

Yes, the docs in that place are good.
Hey one more query john.
I am not applying the headings and numbering manually.
I already have a document with random headers, numbered lists etc, etc.

Then I have to write a macro that identifies everything and gives
different
indentations for the headings, numbered lists and bulleted lists. Hows
that man.
 

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