Re: BookMark in Header by Doug
Doug
Tue Oct 26 18:29:44 CDT 2004
Yes, the form does need to be protected for the formfields to work. Run a
macro containing the following code on exit from the formfield to get the
cross reference in the header to update:
With ActiveDocument
.Unprotect
.Sections(1).Headers(wdHeaderFooterPrimary).Range.Fields.Update
.Protect wdAllowOnlyFormFields, NoReset
End With
--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.
Hope this helps,
Doug Robbins - Word MVP
"Staceman" <Staceman@discussions.microsoft.com> wrote in message
news:EAA18370-D022-43D2-913F-048CFBAF761F@microsoft.com...
>I have not been able to do it that way. I have a Bookmark named
> bkContractNum and a {Ref bkContractNum} in the header, as well as one in
> the
> body to troubleshoot. When I create a new document, my fill in form comes
> up, I enter the Contract Number, click OK and the macro fills in the Ref
> in
> the body, but not the header. I have been reading (via Google) that Word
> won't allow this when a doc is protected. I guess I should ask a couple
> of
> quick questions:
> 1) Should I be using a Bookmark or a FormField?
> 2) Does a form have to be protected to allow an omline form to work with a
> Fill In form?
> 3) When in the Header, it will not allow you to enter a Text Form Field,
> is
> there a way to do it in the body and then paste it into the Header?
>
> "Åsa Holmgren" wrote:
>
>> Yes, thats possible, just go ahead ;-)
>>
>> ActiveDocument.Bookmarks("MyBookmark").Range = "My contract number"
>>
>> /Asa
>>
>> "Staceman" <Staceman@discussions.microsoft.com> skrev i meddelandet
>> news:43BF3A5C-BBBD-494D-BECA-3376AB2034AC@microsoft.com...
>> > Is it possible to reference a Bookmark in a header?
>> >
>> > I am creating a contract with a Fill In Form that will open
>> > automatically
>> > via AutoNew, the user will fill in the blanks and click OK. Word will
>> > populate the information throughout the document for the user. We need
>> > a
>> > contract number to be placed in the header bc it needs to be on every
>> page.
>> >
>> > Any ideas?
>>
>>
>>