Commands for footers

J

John Eddy

Everyone's been so helpful with all of my questions so I
want to thank you all for your help with my project and I
hope this will be my final question.

The document I've been working on has a few fields that
are auto-populated when submitted through our portal. The
cells seem to auto-populate just fine but I cannot seem to
get the footer to autopopulate the same way. In a cell I
use a code such as "<POLICY_NM>" and it inserts the policy
number into that cell for the user. but to insert that
into footer just gets me "<POLICY_NM>" at the bottom of
each page.

I assume there is some way to have a footer equal the
value of a cell. If there is I could just simply take this
information from the top of the document where it is
autopopulated to repeat it at the bottom of each page. I
can't seem to find any code for this but I'm hoping there
is.

Thanks again for all your help!

John
 
J

John Eddy

Well, this is the code: <Policy_NM>. I don't have much
experience with this portal (Lotus Notes and Domino.Doc)
but we have a few documents that have these codes in them.
When they are submitted to my department through the
portal the code is replaced with the policy number by
Lotus. This does not work with headers and footers though.
Due to the fact that I know very little about how this
works, instead of trying to figure it out I'm simply
trying to figure out how to have a footer reference a
cell. The information is already auto-populated into the
cell correctly with the code so I'm hoping I could get
something along the lines of

ActiveSheet.PageSetup.LeftHeader = _
 
J

John Eddy

hmm...maybe I type too much it posted while I was typing!
Here's the code I was typing:

ActiveSheet.PageSetup.LeftHeader = _
Format(worksheets("Sheet2").Range
("B5").Value)

That's for Excel though, I can't figure out how to
reference cells in Word and I'm not even sure if it would
work.

Thanks!

John
 
J

John Eddy

Oh, Here's your reply. I replied to my last message
because your's hadn't shown up yet.
 
D

Doug Robbins - Word MVP

Hi John,

I responded to your later post in this group with information on how to get
the text that is located in the first cell on the first row of the table
into the footer of the document

I am not sure how you want the information from B2 and D4 to be arranged, so
I've assumed that you want the pieces separated by a space then a hyphen
then a space.

Dim myrange as Range, mystring as String

Set myrange = ActiveDocument.Tables(1).Cell(2, 2).Range
myrange.End=myrange.End - 1
mystring = myrange
Set myrange = ActiveDocument.Tables(1).Cell(4, 4).Range
myrange.End=myrange.End - 1
mystring = myrstring & " - " & myrange
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.InsertBefore
mystring

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP
 

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