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,
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,