Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

Problem with Indentations

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sorcerer - 15 Mar 2005 10:26 GMT
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
Jonathan West - 15 Mar 2005 10:30 GMT
> 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

MsgBox PointsToInches(Selection.ParagraphFormat.LeftIndent)

Signature

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 

Stefan Blom - 15 Mar 2005 10:38 GMT
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

Signature

Stefan Blom

> 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
sorcerer - 16 Mar 2005 13:05 GMT
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.
Jonathan West - 16 Mar 2005 13:27 GMT
> Hi Guys
> Hey what is the relation between,
[quoted text clipped - 5 lines]
> 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

Signature

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 

sorcerer - 16 Mar 2005 14:25 GMT
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.
Jonathan West - 16 Mar 2005 14:46 GMT
> 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.

Signature

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 

sorcerer - 16 Mar 2005 15:08 GMT
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.
sorcerer - 17 Mar 2005 09:55 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.