Re: Word's "Entire Document" XML tags are fragile!



Hi Brian,

I think I've figured this one out... it appears based on the vague
exceptions that I am getting, that with protection on, I can't modify the
document while it is protected, including adding editable ranges. I have
modified my code to unprotect/protect the document whenever I need to make
mods; and to do:

myDoc.XMLNodes[1].Range.Editors.Add(ref editorID);


if the document should be editable by my users. There the assumption is
that the first XMLNode in the XMLNodes collection will always be the
outermost one. I can't find any documentation to that effect, but it seems
to be the case.

Does that all sound right??

It all sounds right :-)

One thought: if you know from the start that the user will be structuring the
file with XML tags, you could transform it to include the outerlevel tag and
the XML when opening it? (Save you from needing to fiddle with the protection
via automation.)

Actually, I think you could even use a transform instead of automation even
once the document is open...

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 :-)

.



Relevant Pages

  • Re: New concept in software protection
    ... What are the advantages of such "protection"? ... > program because you don't need to transform its entire code. ... > jmp +$00000eec ... > mov ebx, eax ...
    (comp.security.misc)
  • Re: Runtime error 4605 problem with template
    ... I am not finding any protected sections of the template. ... The same bookmark in the template is no protected. ... How can I find the protection that is turned on and disable it? ... in automation I open the document and populate various bookmarks from ...
    (microsoft.public.word.vba.general)
  • RE: how do i password protect an .xls file? how do i unlock it for aut
    ... > how do i password protect an .xls file? ... how do i unlock it for automation. ... Do you want file protection or just workbook or worksheet protection? ...
    (microsoft.public.excel)