The user may have the macro security level set to high and if test.doc is
not in a trusted location, the macros in it would be automatically disabled.
Test.doc should be saved as a template (.dot file) and then should be copied
into the user template folder or the workgroup template folder and the use
should use File>New and then select the template as the basis for the
document that they want to create. That way, the macros in the template
will be available for use in the new document that the user creates.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
"BJ"
news:4F6E78EF-6021-4A9B-BA61-5F8450F6AB25@microsoft.com...
> The document which is created from the test.doc is a protected document.
> here
> is the code:
> *******************************
> Sub CheckValidDate()
> On Error Resume Next
>
> Set thisDoc = Application.ActiveDocument
>
> If thisDoc.FormFields("txtThisDate").result = "" Then
> MsgBox "Please Enter the ""Date This Appraisal"" Field.", vbOKOnly
> +
> vbExclamation, _
> "Missing Information Message"
> thisDoc.FormFields("txtThisDate").Select
> End
> Else
> If CDate(thisDoc.FormFields("txtThisDate").result) >
> CDate("12/24/2006") Then
> blNewPro = True
> Call ShowNewPACE
> Else
> blNewPro = False
> If blFirstTime = True Then
> blFirstTime = False
> Else
> Call ShowOldPACE
> End If
> End If
> End If
>
> If thisDoc.FormFields("txtLastDate").result = "" Then
> MsgBox "Please Enter the ""Date Last Appraisal"" Field.", vbOKOnly
> +
> vbExclamation, _
> "Missing Information Message"
> thisDoc.FormFields("txtLastDate").Select
> End
> ElseIf CDate(thisDoc.FormFields("txtThisDate").result) <= _
> CDate(thisDoc.FormFields("txtLastDate").result) Then
> MsgBox """Date This Appraisal"" must be greater than ""Date
> Last
> Appraisal"".", vbOKOnly + vbExclamation, _
> "Invalid Information Message"
> thisDoc.FormFields("txtThisDate").Select
> End If
>
> End Sub
> *******************
>
> It's called when exit the text form fileld.
>
> Thanks.
>
>
>
> "Graham Mayor" wrote:
>
>> What does the macro do? Post the code?
>> Is the form locked on the user's PC?
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>>
>> BJ wrote:
>> > I am using a 'Text form Field' in a word template for user to enter a
>> > date. and set up to run a macro when user exit from this text form
>> > field.
>> >
>> > it works fine on my machine. either tab out from the field or click on
>> > somewhere else. the header will be changes based on the date i
>> > entered. but, on a user's machine, the macro didn't run the first
>> > time user tab out the field. user has to go back to the field and tab
>> > out again to trigger the macro.
>> >
>> > can someone let me know why this hapened? is this because the user has
>> > different settings or what?
>> >
>> > Thank you for any help.
>>
>>
>>