spoke too soon, word 2k is happy, word 2007 isn't, errors out on
closing the form and the protect line of code
--
Dale wrote:
Graham, I did go with unprotecting and protecting the document to open
the email form. It works well, and because my save event happens
before the show.form macro, the saved document is also protected. It
may not be elegant but it works and my life can start again!!
--
Dale wrote:
Graham,
One last time I hope..this form is going to be the death of me, it
shouldn't have been this difficult! I designed this form in word
2007, but have since had to redesign in 2000 as we have a wide
disparity of office versions. My newest problem: I'm trying to open
a form and I'm not sure why this form would be any different than the
pop up calendar, but I am now getting an error when using
(semail.show) which is an "email" form, on the protected document.
The error is a runtime error 4605 "method or property is not avaiable
as the object or property it refers to is in a protected area of the
document". The code works in 2007 but it appears 2000 is less
tolerant! Again I don't see how this is any different from opening a
calendar form. Do I have to unprotect the document, open the form run
the email routine behind the form, close the form and then protect
the document, which is not desirable as the saved document would also
be unprotected.
thanks....very close to disabling all macros and going plain jane!!
--
Graham Mayor wrote:
You are welcome
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Thank you so much Graham, I would never have come up with that and
I've been trying for 2 days!!
--
Graham Mayor wrote:
Public Function GetCurrentFF() As Word.FormField
Set rngFF = Selection.Range
rngFF.Expand wdParagraph
For Each fldFF In rngFF.FormFields
Set GetCurrentFF = fldFF
Exit For
Next
End Function
Run the macro on entry to the date form fields to pop up the
calendar/date
Sub Calendar()
frmCalendar.Show
End Sub
Using the code from my web site, make the changes as required
Private Sub Calendar1_Click()
Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
oFld(GetCurrentFF.name).Result = Format(Calendar1.Value, "dd mmmm
yyyy") Unload Me
End Sub
Private Sub CmdClose_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Calendar1.Value = Date 'start with today's date
End Sub