Disable "Disable Features Introduced After" if currently enabled.

S

Sharat Koya

Hi, I was referenced to here from the VBA group as I have been trying to
disable the "Disable Features Introduced After" option in word but it has had
side effects. Please can someone help me with the following..

-------
Ok that works great in the VBA when the document is open. I am also
attempting to disable the feature before my document gets launched from C#
using Interop.

I can sucessfully create the document:
-Microsoft.Office.Interop.Word.Document doc = word.Document.Open(ref
wordFilePath, ...... );

I then check to see if "Disable features introduced after" is enabled and
disable it:
-if (word.Options.DisableFeaturesbyDefault)
- {
- doc.DisableFeatures = false;
- word.Options.DisableFeaturesbyDefault = false;
- doc = null;
-}


I then open the document where I don't want "Disable features introduced
after" enabled:

-doc = word.Documents.Open(ref wordFilePath, ...);

I then use the doc.SaveAs command to save as a word document as the original
was a template:
-object docFormat = WdSaveFormat.wdFormatDocument;
-doc.SaveAs(ref wordFilePath, ref docFormat, ref missing ...);

When I trace through this code both
word.Options.DisableFeaturesbyDefault and doc.DisableFeatures are false.

As soon as the document is saved using doc.SaveAs the doc.DisableFeatures
property gets set to true and any subsequent document has the "Disable
Features introduced after" enabled. Should this happen when using the SaveAs
features?

I am guessing that the SaveAs method retrieves older settings from the
registry under
\\HK Current User\Software\Microsoft\Office\11.0\Word\Data as deleting this
key and then restarting Word disables the option and looses all compatibility
options.

Is there another method of disabling the feature without side effects?

thanks for any time spent on this,
 
C

Cindy M.

Hi =?Utf-8?B?U2hhcmF0IEtveWE=?=,
I then open the document where I don't want "Disable features introduced
after" enabled:

-doc = word.Documents.Open(ref wordFilePath, ...);

I then use the doc.SaveAs command to save as a word document as the original
was a template:
-object docFormat = WdSaveFormat.wdFormatDocument;
-doc.SaveAs(ref wordFilePath, ref docFormat, ref missing ...);
Don't do this. Use the Documents.Add rather than Open method to create a
document from a template. That might also make a difference for the problem
you're more concerned about :)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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 :)
 
C

Cindy M.

Hi Sharat,
There is a bug in word it seems that hasn't got a resolution yet:

http://support.microsoft.com/kb/832349

do you think using documents.add will resolve the issue and if so why?
Thanks for information about the bug. Given this, no, I don't think
using Documents.Add will change that. But you should use it, anyway :)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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