MS Word 2003 C3 Addin problem

M

Mick Astley

Hi

I've faced to strange problem with my MS word Addin.
Its function is to analyze source Word document and add indentation and
numbering to paragraphs respecting to some heuristic rules. Recently I've
decided to add to it a preprocessing stage, that cleans double spaces, empty
paragraphs, ect using selection.Find.Execute() function. Everything works
fine. However when I decided to remove some paragraph formatting attributes
(namely KeepWithNext) using this function I discovered that it works just if
the program performs only preprocess stage. And if program then performs
analisis and numbers paragraps - formatting changes are getting lost!

I've tried to use another methods for clearing this paragraphs attribute,
for example:
selection.WholeStory();
selection.ParagraphFormat.KeepWithNext = 0;
Result is same - works only if main stage of program is not running.

I've also tried to clear this attribute out on analisis of paragraphs - does
not help as well.

Can someone give me an advise on this problem?

Thanks in advance,
Mick.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?TWljayBBc3RsZXk=?=,

The first thing that occurs to me is that the formatting you're trying to
remove is style-linked. And as soon as you apply or refresh that style, the
formatting is coming back.
I've faced to strange problem with my MS word Addin.
Its function is to analyze source Word document and add indentation and
numbering to paragraphs respecting to some heuristic rules. Recently I've
decided to add to it a preprocessing stage, that cleans double spaces, empty
paragraphs, ect using selection.Find.Execute() function. Everything works
fine. However when I decided to remove some paragraph formatting attributes
(namely KeepWithNext) using this function I discovered that it works just if
the program performs only preprocess stage. And if program then performs
analisis and numbers paragraps - formatting changes are getting lost!

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
M

Mick Astley

Hi, it looks you're right! After preprocessing I'm updating document styles!
I need to think how to change the program to avoid this problem.

Thanks a lot!! :)
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?TWljayBBc3RsZXk=?=,
After preprocessing I'm updating document styles!
I need to think how to change the program to avoid this problem.
Maybe remove this formatting from the style definitions, where
appropriate?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8
2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 

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