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
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
On 23/1/07 12:20 AM, in article
017E04E0-30EB-4AF3-9631-27D76597CF8B@microsoft.com, "ByteMe"
> Well, when running the script, he suddenly doesn't apply the style anymore.
> (Same code in a for-loop)
[quoted text clipped - 8 lines]
>
> Thanks for your help

Signature
Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.
John McGhie <john@mcghie.name>
Microsoft MVP, Word and Word for Macintosh. Business Analyst, Consultant
Technical Writer.
Sydney, Australia +61 (0) 4 1209 1410