styles not wokring in huge document

B

ByteMe

Hi,

I'm trying to create a huge document that can't be splitted in MS Word 2000
using VBA.
The document is about 130 pages, containing just text and titles, and has
about 10 styles which are used plenty.

At some point when creating the document, Word doesn't accept styles anymore.
(some style will work longer then other). Created a break in VBA on that
place, and tried to do it manualy in Word; Same result. He won't change the
Style.

Is there a known limit on how many characters you can fit into a style or
how many times you can apply a style?

Thx
 
J

Jezebel

130 pages is not huge. I've used VBA to create documents that were well into
the thousands of pages (largest was over 10,000 pages), and the styles all
worked exactly as expected.

So at a guess, you've got something else altogether going wrong. Perhaps if
you posted the code?
 
S

Stefan Blom

In what way doesn't Word "accept" the styles? What happens?

Are you working with selections (not so good)? With ranges
(preferable)? What code is used?

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
B

ByteMe

Well, when running the script, he suddenly doesn't apply the style anymore.
(Same code in a for-loop)

When I skip the creation of the first pages, the application of styles is
also shifted.
Meaning that its not related to the text itself.

When the document is created, i can't select a piece of text and apply a
style.
The little styles-dropdownbox goes back to the actual style.

Thanks for your help
 
J

Jezebel

Why bother with this? Why not predefine your styles in a template, then base
your documents on that template?

There's nothing conspicuously wrong with your code; but your use of
'typetext' as a means of creating your document suggests that you haven't
done much research on how to go about this task. Even so, this doesn't
explain your problem. Word doesn't have a problem 'accepting' styles, even
in a large document. Stop looking for a fault in Word: the problem is a bug
in your code.
 
J

John McGhie [MVP - Word and Word Macintosh]

You have a conflict occurring within your styles. It may be a circular
reference in the "Based On" property.

Doing this rapidly many hundreds of times in VBA causes the style table
within the document to corrupt.

After that, you will be unable to write to the style table, and thus will be
unable to apply any styles.

If you "Maggie" the document (create a new document and copy all except the
last paragraph mark to it) that will write a new style table, and you may
then be able to see what is wrong with your styles.

Sorry: Doing this with VBA is very intricate: you have to get everything
exactly correct or you get these problems.

It is most likely that the problem is occurring in the module that creates
the style, not in the module that applies the style.

Cheers

Well, when running the script, he suddenly doesn't apply the style anymore.
(Same code in a for-loop)

When I skip the creation of the first pages, the application of styles is
also shifted.
Meaning that its not related to the text itself.

When the document is created, i can't select a piece of text and apply a
style.
The little styles-dropdownbox goes back to the actual style.

Thanks for your help

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Business Analyst, Consultant
Technical Writer.
Sydney, Australia +61 (0) 4 1209 1410
 

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