Re: Changing Locked property of Fields in Doc without using Documents.



Although I can't see a way to open the document via Word without Word
updating the date fields, on the Windows version I think it would be
possibel to inspect the value of
ActiveDocument.BuiltInDocumentProperties(wdPropertyTimeLastSaved), extract
the date from that, and stuff it programmatically into the document.

Or maybe something along those lines...

Peter Jamieson
"mansky99" <mansky99@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:696D2110-7F29-409A-BD0F-D7FBB577D972@xxxxxxxxxxxxxxxx
Hi,
I have a User who, by mistake, used a Date Field in Word documents to
place
a date in a document. The intention was to have that date to be fixed and
unchanged
the next time the document was opened. The dates are journal entries (ie.
a
date and some text)
and hence it's important that the dates remain unchanged upon subsequent
use
of the file.

I have a script to go thru all the Word docs on the machine where the
problem resides.
However, it appears that I have to first use the method Documents.Open
before I can use the method Documents.Fields.Count to see if there are any
fields in a given document.

Here's a code snippet of the script to toggle the Locked property of all
fields in a given document
from False to True :
For i = 1 To NF
Fullname = Pathnames(i) & Filenames(i)
Documents.Open Filename:=Fullname
If (Documents(Fullname).Fields.Count > 0) Then
For Each ADF In Documents(Fullname).Fields
If (ADF.Locked = False) Then
ADF.Locked = True
Documents.Close SaveChanges:=wdSaveChanges
Else
Documents.Close SaveChanges:=wdDoNotSaveChanges
End If
Next ADF
End If
Loop i

where the Variant arrays Pathnames and Filenames contain the paths and
filenames of all the
Word documents on the affected machine.

The problem is that as soon as Documents.Open is called, the date fields
(as
per design) are updated, thereby nullifying my script.

I'd like to change the Locked property value of any fields in a given
document from False to True
(to thereby prevent subsequent updating of date fields), but I can't seem
to
get around using
Documents.Open. If I leave out the call to Documents.Open, I get a 'Bad
filename' error from the
Documents(Fullname).Fields.Count statement.

Any ideas on how to toggle the Locked property, or other ideas would be
greatly appreciated!

Ed





.



Relevant Pages

  • Re: Changing Locked property of Fields in Doc without using Docume
    ... Thanks Peter, that's a good idea. ... Here's a code snippet of the script to toggle the Locked property of all ... filenames of all the ...
    (microsoft.public.mac.office.word)
  • Re: libicui18n.so.36 not found, required by "evolution"
    ... It will only fetch programs that need updating, ... Later this day I will add some debugging functionality to the script and send that version to you, if you are willing to spend your time helping me finding this problem. ... And indeed pkg_libchk is by far the best solution, if I was to update every package that depended on icu I would have to update 239 packages which discouraged me right away, by running pkg_libchk the amount of packages to be updated was reduced to 71, wrote a quick script and left it running overnight and those packages got updated and by god I don't have any more problems with libicui18n.so.38. ... And until then you already have a description for all new commands. ...
    (freebsd-questions)
  • dealing with lengthy (time) query sets
    ... updating tables accordingly and all is good. ... My original idea was to spawn a thread off the subroutine and then it could go do all the work it likes leaving the main section to continue on chugging through input. ... So i gave up on that and figured i do it with fork, however there are apparently issues with keeping the database connection associated with that. ... My last resort which i know works is to make another script that makes its own database connection does its work and dies. ...
    (perl.dbi.users)
  • Import Issue
    ... I am facing a problem while importing a file in python ... After doing import file i am updating that file. ... Eventhough changes are reflected in the file... ... the start of the script. ...
    (comp.lang.python)
  • Re: calling included remote functions
    ... >if/when I want to tweak the code, I don't want to have to go updating all ... In other words you send information to the processing script (e.g. ... If the photo links were absolute there is no reason why ...
    (comp.lang.php)