Thread: line numbers
View Single Post
  #27   Report Post  
Posted to microsoft.public.word.docmanagement
Peter T. Daniels Peter T. Daniels is offline
external usenet poster
 
Posts: 3,215
Default line numbers -- solved

Why would I thank _you_ for what he did?

On Nov 3, 2:18*am, "Gordon Bentley-Mix"
wrote:
What a guy that Greg Maxey is! After all the abuse you've heaped on him over
the months and years, he still has the kindness in his heart to find a
solution to your problem. Do I hear a thank you?

(A little bit corrupt? Is that like a little bit pregnant? g)
--
Cheers!

Gordon Bentley-Mix
Word MVP

"Peter T. Daniels" wrote in ...



Greg discovered (by copying it section by section without the section
breaks or final paragraph mark) that my document was just a little bit
corrupt. Everything now works just as expected.


On Nov 2, 1:06 pm, "Peter T. Daniels" wrote:
On Nov 2, 12:23 pm, "Greg Maxey"


wrote:
Mr. Daniels,


Lacking your skills in reading for content vice context and not knowing
what
people really mean by what is unsaid, is all this gibberish an
admission
that what you declared as impossible last night you now realize is
possible
today?


A hammer for setting linenumbering programmatically was handed to you
in my


I saw a hammer for setting Section right-to-left, but not a hammer for
setting line numbering. I also do not see such a hammer in the macro
included in the .docm in question.


An explanation of why a command included in a macro might work while
the same command accessed via the GUI might not would be most
interesting.


first response to this tortured thread. *Being something over your head
and
unworthy of your attention you chose to treat it with scorn rather than
as a
useful tool. *Now you grouse about its absence in the Mr. Daniels'
Arrogant
Folly document. *Which is it Mr. Daniels? *We both know that with the
discovery of the Section direction option in PageLayout (You know the
option
that you couldn't find. *That had it been a snake it would have bitten
you)
that a macro isn't required. *Still, to temper your fresh round of
grumbling
here it is:


Sub DanielsWantsAHammer()
With ActiveDocument
* With .Sections(1) *'This is the left to right Mr Daniels' Arrogant
Folly
text
* * With .PageSetup
* * * .SectionDirection = wdSectionDirectionLtr
* * * With .LineNumbering
* * * * .Active = True
* * * * .StartingNumber = 1 'or whatever
* * * * .CountBy = 1 'or whatever
* * * * .RestartMode = wdRestartSection 'or whatever
* * * * .DistanceFromText = 12 'or whatever
* * * End With
* * End With
* End With
* With .Sections(2) 'This is the Arabic text
* * With .PageSetup
* * * .SectionDirection = wdSectionDirectionRtl
* * * With .LineNumbering
* * * * .Active = True
* * * * .StartingNumber = 1 'or whatever
* * * * .CountBy = 1 'or whatever
* * * * .RestartMode = wdRestartSection 'or whatever
* * * * .DistanceFromText = 12 'or whatever
* * * End With
* * End With
* End With
End With
End Sub


If you can curb your arrogance and rants long enough to send me your
troublesome file, I would be delighted to try to find a solution for
you.
NB that that I said "try." *You being a dilletante and all there is no
telling what sort of disaster you have created. *How was it that you
put it?
Oh yes. *That's your problem, not to be transferred to
others who happen to have more skill working with Word.


Cheers.


--
Greg Maxey


See my web sitehttp://gregmaxey.mvps.org
for an eclectic collection of Word Tips.


"Peter T. Daniels" wrote in
...
In the middle of the night, Sociopath Maxey began whining to the
newsgroup that I wasn't acknowledging his messages, so he emailed me a
document that does indeed contain Arabic text, in a right-to-left
section (apparently he failed to read the posting to which he appended
this response), that does indeed contain line numbering in the right
margin. Extending the sample text to more than 4 lines, I found that
it also works with counting every fifth line.


This does not explain, however, why the line numbering does not appear
on screen at all in my actual file within a right-to-left section
containing actual Arabic text, or why when the page is printed, the
line numbers do appear -- printed over the text -- inset from the
right margin.


I experimented with each of these parameters: changing the font from
TNR to the one I was using ("Arabic Typesetting"); line numbering in
This section only; Next page section break instead of Continuous;
narrowing the margins to match those in my document. In each case,
line numbering appears properly in Greg's document and not in my
document.


His document includes the macro for changing section direction, but
the macro does not appear to contain a line number command.


On Nov 2, 1:05 am, "Greg Maxey"


wrote:
Mr. Daniels,


You were the one that posted here claiming it didn't exist. Where you
blinded by arrogance?


I looked before enabling an Arabic language. Hopefully my self
admitted
ignorance of the world's languages wiil excuse the oversight.


Would you like for me to post a picture for the whole world to see or
send
you an example?


Peter T. Daniels wrote:
As usual, when all you have is a hammer, everything looks like a
nail


The existence of a "SectionDirection" command within PageSetup
prompted me to look more closely for the option.


In order to make a section read right-to-left, go to Page Setup
Layout second dropdown at the top.


No macro needed.


However, though line numbers are checked, they do not display. (In
fact, they blinked off when I Ok'd the Page Setup Layout change,
though the Line Numbers box was still checked.) So it appears
_still_
to be impossible to get line numbers in the right margin with
right-to- left text.


On Nov 1, 7:55 pm, "Greg Maxey"
wrote:
Yes.


If you have an appropriate language enabled (e.g., Arabic (Iraq))
then you can use a macro to set specific section direction. For
example the following macro will display line numbers in the right
margin in secton 1.


Sub ScratchMaco()
ActiveDocument.Sections(1).PageSetup.SectionDirect ion =
wdSectionDirectionRtl
End Sub


Note: If you do not have an appropriate language enabled (I defer
to
Mr. Daniels' expertise on what other languages may or may not be
appropriate) or subsequently disable the language then this
setting
will suppress the display of line numbering. To restore them you
would need to set the direction back to left to right using:


Sub ScratchMaco()
ActiveDocument.Sections(1).PageSetup.SectionDirect ion =
wdSectionDirectionLtr
End Sub


Peter T. Daniels wrote:
I'm typing a page of Arabic. Is there any way to get the line
numbers to appear in the right margin (i.e., at the beginnings of
the lines)? Setting "mirror margins" doesn't do it.


--
Greg Maxey


See my web sitehttp://gregmaxey.mvps.org
for an eclectic collection of Word Tips.


--
Greg Maxey


See my web sitehttp://gregmaxey.mvps.org
for an eclectic collection of Word Tips.--