PrintDate from Protected document doesn't work

L

lojze066

I have the following problem with PrintDate which appears only in Word 2000
In Word 2003 everything works OK. My users unfortunately use Word 2000
(9.0.4402 SR-1)

1) Users demand is that the footer contains PrintDate field
2) Second demand is that when approved, document is protected against
writing with password .

I protect document programmatically with following code

Const wdAllowOnlyComments=1
WordObj.ActiveDocument.Protect wdAllowOnlyComments, False, "PASSWORD"

3) PROBLEM IS FOLLOWING:
After protecting the document, PrintDate, after document has been printed
out, doesn’t work any more It is empty = 00.00.00000.


I also found out that the same problem with PrintDate appears also if I do
everything manually in Word so probably this is a Bug or something.

Can someone give me an advice what to do that PrintDate will work in Word
2000 (9.0.4402 SR-1). Maybe there is fix for this or some workaround?

Thank you

Lojze
 
J

Jean-Guy Marcil

lojze066 was telling us:
lojze066 nous racontait que :
I have the following problem with PrintDate which appears only in
Word 2000 In Word 2003 everything works OK. My users unfortunately
use Word 2000 (9.0.4402 SR-1)

1) Users demand is that the footer contains PrintDate field
2) Second demand is that when approved, document is protected against
writing with password .

I protect document programmatically with following code

Const wdAllowOnlyComments=1
WordObj.ActiveDocument.Protect wdAllowOnlyComments, False, "PASSWORD"

3) PROBLEM IS FOLLOWING:
After protecting the document, PrintDate, after document has been
printed out, doesn't work any more It is empty = 00.00.00000.


I also found out that the same problem with PrintDate appears also if
I do everything manually in Word so probably this is a Bug or
something.

Can someone give me an advice what to do that PrintDate will work in
Word 2000 (9.0.4402 SR-1). Maybe there is fix for this or some
workaround?

Thank you

Lojze

Before you protect the document, convert the field to text (you do not need
the field behaviour, right?):

(object).Fields(1).Unlink

If the footer contains only one fields and this is a primary footer in the
first section of the document, you can do:

Const wdAllowOnlyComments As Long = 1
With WordObj.ActiveDocument
.Sections(1).Footers(wdHeaderFooterPrimary).Range.Fields(1).Unlink
.Protect wdAllowOnlyComments, False, "PASSWORD"
End With


--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
L

lojze066

Jean-Guy Marcil said:
lojze066 was telling us:
lojze066 nous racontait que :


Before you protect the document, convert the field to text (you do not need
the field behaviour, right?):

(object).Fields(1).Unlink

If the footer contains only one fields and this is a primary footer in the
first section of the document, you can do:

Const wdAllowOnlyComments As Long = 1
With WordObj.ActiveDocument
.Sections(1).Footers(wdHeaderFooterPrimary).Range.Fields(1).Unlink
.Protect wdAllowOnlyComments, False, "PASSWORD"
End With


--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org

I tried to do what you suggested but the problem still persists. Print date
when protected document is printed is still empty 00.00.0000.

Interesting is that other fields (name of the doc, some ref fields) in the
footer are printed correctly. I suppose that because they are calculated
before the document is protected.

My need is that also after the document is protected, every time that is
printed changes the print date to current date. So I suppose I need the field
behavior after protection.
 
J

Jean-Guy Marcil

lojze066 was telling us:
lojze066 nous racontait que :


I tried to do what you suggested but the problem still persists.
Print date when protected document is printed is still empty
00.00.0000.

Interesting is that other fields (name of the doc, some ref fields)
in the footer are printed correctly. I suppose that because they are
calculated before the document is protected.

My need is that also after the document is protected, every time that
is printed changes the print date to current date. So I suppose I
need the field behavior after protection.

Did you try my suggestion (to unlink the PRINTDATE field) before or after
printing?

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
L

lojze066

Did you try my suggestion (to unlink the PRINTDATE field) before or after
printing?

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org


I tried to Unlink the field before printing. Maybe I didn't do it correctly?
 
J

Jean-Guy Marcil

lojze066 was telling us:
lojze066 nous racontait que :

Indeed...

If you unlink it before you print, since the document has not yet been
printed, there won't be a date...
You have to unlink after you print.

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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