Re: Using VBA to set "Disable features introduced after" to false.



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 doc.DisableFeatures 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

Is there any way of permanently disabling this feature from C# Interop?

thanks for any time spent on this,

"Jay Freedman" wrote:

It looks like you'll have to do both. This works here (Word 2003):

Options.DisableFeaturesbyDefault = False
With ActiveDocument
.DisableFeatures = False
.Compatibility(wdDontUseHTMLParagraphAutoSpacing) = False
End With

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Sharat Koya wrote:
For sure, but how can I disable the "disable features introduced
after" option without enabling "Don't use HTML paragraph auto
spacing" or do I have to disable both - one after another?

"Jay Freedman" wrote:

The disabled-features items have little or nothing to do with the
compatibility options. The code you want for this is

ActiveDocument.Compatibility(wdDontUseHTMLParagraphAutoSpacing) =
False

This statement has to run after the document in question has been
opened. If you save the document after that, the option will be saved
in the document's file; you wouldn't have to set it again, although
it won't do any harm to do so.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Mon, 16 Apr 2007 04:44:02 -0700, Sharat Koya
<SharatKoya@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi I have tried to use the following line of code to disable the
feature "Save Word files as" option in Word options on document
open:

Word.Options.DisableFeaturesbyDefault = False

by using this I was hoping to disable stop the option from
renabling with older documents also.

I also added the following line :
Me.DisableFeatures = False

However when I launch the document the Compatibility Option "Don't
use HTML paragraph auto spacing" is checked which alters the
location of some of word content.



.



Relevant Pages

  • Re: PostgreSQL pgbench performance regression in 2.6.23+
    ... Also, that requires being intrusive into people's setup scripts, which bothers me a lot more than doing a bit of kernel tuning at system startup. ... I did again get useful results here with the stock 2.6.26.git kernel and default parameters using Peter's small patch to adjust se.waker. ... Combining those two but keeping the rest of the features on actually gave the best result I've ever seen here, better than with all the features disabled. ... Mike suggested a patch to 2.6.25 in this thread that backports the feature for disabling SCHED_FEAT_SYNC_WAKEUPS. ...
    (Linux-Kernel)
  • Re: Mozilla Firefox
    ... And I would be more impressed to see a Microsoft link ... urging developers to abandon ActiveX development. ... > Many of the questionable features are disabled in XP SP2. ... > to stop a user from disabling features that they don't want or need. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Cant used parted to resize recent ext2 partitions, what has changed?
    ... Build current ext2 utils and use tune2fs to check which features are enabled ... Filesystem volume name: ... disabling features on filesystem with live data can potentially ... possible because feature may affect data layout and you can't change data ...
    (linux.redhat)
  • Re: Cant used parted to resize recent ext2 partitions, what has changed?
    ... Build current ext2 utils and use tune2fs to check which features are enabled ... Filesystem volume name: ... disabling features on filesystem with live data can potentially ... possible because feature may affect data layout and you can't change data ...
    (comp.os.linux.setup)
  • Re: Using VBA to set "Disable features introduced after" to false.
    ... I don't have any experience with C# interop or any way to test ... newsgroup so all may benefit. ... Is there any way of permanently disabling this feature from C# Interop? ... "Jay Freedman" wrote: ...
    (microsoft.public.word.vba.general)