Calling macro function from within a header/footer?

M

ML

Ok thanks, just asking it different ways as it gets different results. Some
people didn't even realize conditional page level headers were possible at
all until this thread.

I guess this answers it then, basically those are the options.
 
M

ML

Here is my latest attempt at this. I am thinking of making a macro that
will parse the pages of a dicument and check each for the tags. Based o
nthese tags it will then set a Docvariable that is named based on the
current section and page so that it is unique. Within the header/footer I
then have a field that references the

Docvariable Ex:
{ DOCVARIABLE { =SUM({ =PRODUCT({ SECTION },10000) },{ PAGE\*ARABIC }) }

This basically make up the docvariable name based on an integer to uniquely
define the section and page so the variable is unique within the document.

In my marco, I am planning to run through each page and generate the
variables, that is if that is possible. Is it possible in VBA code to
search a couemnt page by page in a loop, so that if I find a given marker,
which is just a SEQ field the user inserted onto a page then I can in turn
use the logic to set the docvariable?

Any thoughts. comments?
 
T

Tony Jollans

That looks like it should work - I'll remember that one - but I think you'll
have to make sure all the variables exist.
 
M

ML

I added IF check to display a blank string if the variable doesn't exist.
Now All I need to do is figure out the code to loop through the pages and
check for the tags. This method appears to work with manually set variables
at least so far. basically creates a page specific variable that can then
be referenced in the header and is unique to a page not the section.
 

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