Page 1 of 1

turnoff rsid's spell check & grammar check in generated xml

PostPosted: Fri Feb 20, 2009 6:31 am
by codified44
Hi,

it is possible to turn off rsid's in MS Word 2007, so it doesn't inset them?

Also, is it possible to turn off spell check and grammar check entries in the xml?

I want to replace certain marker text. I want to replace the contents of that market text using java. For example, $doc.getTitle() generates xml like shown below and java is not able to find the string $doc.getTitle().

<w:p w:rsidR="00837B97" w:rsidRDefault="00A81F72" w:rsidP="00837B97">
<w:r>
<w:t>$</w:t>
</w:r>
<w:r w:rsidR="00837B97">
<w:t>doc.</w:t>
</w:r>
<w:r>
<w:t>getTitle()</w:t>
</w:r>
</w:p>

Thanks in advance !

Re: turnoff rsid's spell check & grammar check in generated xml

PostPosted: Fri Feb 20, 2009 8:31 am
by jason
You can turn off grammar and spelling checking, globally:

Code: Select all
                Word.Options opts = Word.Options;
                opts.CheckGrammarAsYouType = false;
                opts.CheckGrammarWithSpelling = false;
                opts.CheckSpellingAsYouType = false;


or just in this document:

Code: Select all
                myDoc.ShowGrammaticalErrors = false;
                myDoc.ShowSpellingErrors = false;


It ought to be sufficent to do it just to this document, but that option seems to be about _show_ as opposed to _check_ (ie the proofErr is still stuck into the XML!)

You can make these changes programmatically (ie using VSTO or Word's VBA) as above, or via the Word interface (in Word Options). In the case of the document level settings, I'd expect you can also specify these in the docx xml (but I haven't looked to verify).

Re rsid, the option is:

Code: Select all
                opts.StoreRSIDOnSave = false;


I just had a quick look at Word's user interface, and it wasn't immediately obvious where you set it non-programmatically. If you can see it, pls post...

cheers

Jason

Re: turnoff rsid's spell check & grammar check in generated xml

PostPosted: Fri Feb 20, 2009 8:40 am
by codified44
Thanks Jason.

Which file do i set the properties in?

Re: turnoff rsid's spell check & grammar check in generated xml

PostPosted: Fri Feb 20, 2009 10:19 am
by jason
You make these changes programmatically (ie using VSTO or Word's VBA), or via the Word user interface (in Word Options).

There is no properties file as such, as far as I know. Given that its Windows we are talking about, there may be a registry setting, but either of the above approaches should work...

Re: turnoff rsid's spell check & grammar check in generated xml

PostPosted: Sat Feb 21, 2009 12:19 am
by jason
The document level properties you can also set on the Developer tab in Word (once you have turned it on).

On the Developer tab, press the Design Mode button; then the Properties button should be enabled for you to click.

Re: turnoff rsid's spell check & grammar check in generated xml

PostPosted: Wed Mar 04, 2009 8:47 am
by codified44
Hi Jason,

It can be done from MS Word 2007 Application.

To Remove RSID

1. Click the Microsoft Office Button, and then click Word Options.
2. Click Trust Center, and then click Trust Center Settings.
3. Click on Privacy Options
4. UNcheck "Store random number to improve combine accuracy"

To Remove Grammar and Spell check

1. Click the Microsoft Office Button, and then click Word Options.
2. Click Proofing
3. CHECK "Hide spelling errors in this document only"
4. CHECK "Hide grammar errors in this document only"

Thanks!