line numbers

P

Peter T. Daniels

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.
 
G

Greg Maxey

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
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 site http://gregmaxey.mvps.org
for an eclectic collection of Word Tips.

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.
 
P

Peter T. Daniels

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.
 
P

Peter T. Daniels

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.

Mr. Daniels,
Lacking your skills in reading for content vice context and not knowingwhat
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 thanas 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.
See my web sitehttp://gregmaxey.mvps.org
for an eclectic collection of Word Tips.
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.
 
G

Gordon Bentley-Mix

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>)
 
P

Peter T. Daniels

Why would I thank _you_ for what he did?

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
 

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