Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 2k3 - can I suppress renumbering?

Status
Not open for further replies.

MakeItSo

Programmer
Oct 21, 2003
3,316
DE
Hi friends,

I am stumped by a seemingly simple Word thingy:
I sometimes edit Word documents with a translation tool (basically a set of Word macros).
If the document contains no text boxes, I edit in "Normal" view to avoid the constant and annoying re-pagination in print view.

However, with fairly large documents, another issue pops up, which is the constant and equally annoxying "renumbering" function of Word, which also happens in Normal view mode.
Every time I "close" one sentence (translated) and "open" the next (untranslated), nothing happens until Word is done with
"Renumbering of [document.doc], Page xx of yy in progress..."
I can abort this with the ESC key, but then I also have to confirm that I really wish to abort which is all in all pretty annoying and especially: time-consuming!

Is there any command with which I can deactivate this renumbering for the time I am working with the doc and simply reactivate it when I'm finished?

I am posting this here, as I assume that this must be set programmatically.

One renumbering/repagination at the end of my editing session would fully suffice!

Thanks for any hint!
Andy

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
I've never seen that, and I don't think it is a Word message. You might have to look inside your translation tool.

(I'm assuming you have background repagination turned off)

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Yes, background pagination is turned off.

And although it is caused by the document manipulations performed by translation tool, it definitely is a Word message and a Word function. I've found several threads in other forums dealing with this problem, alas none provided any better answer than "switch to normal view, deactivate background pagination". Goes without saying that none of these solved the problem.

There are several translation tools on the market which practically all have this issue.
What such translation tools actually do is
[ul][li]add/remove bookmarks[/li]
[li]format text as hidden [/li]
[li]apply styles [/li]
[li]insert text[/li]
[li]insert special character combinations as delimiters of the translation segments.[/li][/ul]
This content manipulation then triggers said re-numbering, which is probably a recalculation of outline / level / reference / paragraph numbering rather than a pagination.
As Word does not store such numberings but rather calculates them, such content manipulations obviously trigger a recalculation.

I cannot manipulate the VBA code of that translation tool as it is a commercial product and the code is protected.
However I sincery doubt that there is any code line like
Code:
ActiveDocument.Recalc
or the like.

But is there some command that would do the opposite?
Code:
ActiveDocument.Recalculation = False
or something like that?
[ponder]

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Seems like the ActiveDocument.Repaginate method is called.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Seems like the ActiveDocument.Repaginate method is called.
I doubt that.
I know the status bar message that appears on repagination. This one is different.
No "page breaks" or "pagination" being calculated. The status bar message is clearly about "Numbering".
Plus: I have deactivated background pagination and am working in normal view mode.

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
>Is there any command with which I can deactivate this re[paginating]

Not that I am aware of. It looks very much as if the translation tool is deliberately firing off this repagination (as per PHV's ActiveDocument.Repaginate note) rather than it simply waiting for Word to do a repaginate itself in the background (which is in any case disabled in your situation, as you have stated).

There can be plenty of reasons why a tool might think this essential, particularly if it is relying on information that could only be corrrect if the repgination has occurred. If the tool does not offer a method of disabling this then you are probably out of luck.
 
Update:

I think I might have found something:

I have tried reproducing this with the only translation tool at my disposal that permits access to its VBA modules. It is my preferred translation tool, alas the especially problematic documents always contain embedded high-resolution images on 200+ pages and this translation tool works exclusively with RTF files.
Imagine a 30 MB *.DOC with high-res photos saved as rtf and you'll know why I can't use this tool...

Anyway: I've tried reproducing on a similar doc with linked images and - it didn't repro.
[ponder]

So I checked the code and found this nice little comment line repeatedly :
Code:
[green]' Use Selection instead of o_Char to avoid repagination in XP[/green]
Selection.Start = o_Char.Start - 1

Obviously, o_char is a Range variable (not DIMmed).
Equally obviously manipulating the Range object does trigger repagination whereas manipulating the Selection object doesn't!
[eek]
Does this make sense to any of you?
[3eyes]

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Update:

by using the method of deep contemplation, I think I know the reason - AND that there is no solution to it, at least not with this (repaginating) tool:

Very obviously, it works not with the Selection but with the .Range object.

When translating, naturally the Value of Range.End changes. probably the Range then needs to be re-calculated in order to ... ummm... whatever.

Not really logical IMHO but obviously the unalterable truth.
[sadeyes]

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Interesting that you say the tool works only on RTF. AFAIK, once a document is open, it makes no difference where it came from, and it is not held internally in rtf format, so is the tool working on the document source?

I can't find this message anywhere in Word (which, of itself, does not mean it does not exist) but I find it all a bit odd. First renumbering isn't what Word does to pages - it might renumber chapters, lists, etc., but not pages. Secondly, if it were renumbering pages, it wouldn't really be able to report Page xx of yy - or does yy keep changing? Next, it is strange that the source of the data for a property setting should make a difference (o_Char is not being changed), and why XP specifically? Do you see the same issue under any other Windows version? In fact, the comment makes little sense by itself; if using Selection instead of o_Char really removes a problem, why [did the writers] not just do it instead of commenting the fact?



Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Hi Tony,

yes, this specific (non-repaginating) tool actually does - partially - work with the source. It's VBA modules are for Word interaction, but the actual tool core is a standalone exe + dlls. As it also occasionally stores certain Word RTF encoding, it seems to be accessing the Rich Text source, which is why it always converts Word DOCs to RTF before actually starting work.


Renumbering vs. repagination: That may be a simple translation issue. I have a German word and the message is different from that in Print view. That's why I called it "renumbering" instead of "repaginating".

P.S: it doesn't actually say renumbering page xx [red]of yy[/red] - my mistake. Simply the page number currently processed.

Re "XP": I assume this part of code dates back to adaptions to Word XP (not Windows). Probably certain things about handling Selection/Range had changed with Word XP VBA.

The difference concerning the Source:
During translation, Selection.Text is unaffected by Range growing/shrinking, whereas Range(1000,1050).Text may change.

Why the commenting? Why not? The programmers' staff will surely change over the years. One may not be aware of the repagination/renumbering issue and may think:
"What the devil? Programming with "Selection"?? Bloody amateurs!"
[tongue]

[navy]"We had to turn off that service to comply with the CDA Bill."[/navy]
- The Bastard Operator From Hell
 
Thanks, Andy. I think I misunderstood the comment - it's explaining the use of selection, not the lack of use of it on the other side of the assignment. And I never think of Office when I see XP because, although it is Office XP, the individual apps are, e.g. Word 2002, not Word XP.

I'm not sure I understand what may be going on, and I fear you may be stuck with it, although I can't see why it's necessary (if it is).

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top