I am new with vba, first time using it and not much of a programmer at
all.
I have managed to create a macro that automatically detects landscape
and portrait pages, and then insert an autotext entry into their
headers (a different one for landscape and portrait). Now I need to
make the info in the headers come from an a userform or inputbox
(inpubox is prefered because is just two pieces of info and it seems
easier). So now what am I supposed to do?
My guess of what I have to do in order is this

1) modify the autotext entry to include some sort of field
a) DocVariable?
b) REF ?
c) Bookmark?
Can you please tell me which of these I need and give me a precise
example
of how to add this? (I believe each of the three is added in a
different
way).
Also, it seems the term Bookmark and REF field are either used
interchangeably or are intimately related...can you please tell me
what
each one is used for?

2) Add some code in my macro to insert the text variable I collected
using the
InputBox into the field/variable/bookmark (whichever I am supposed
to use)
a) is this code supposed to be inserted at the very end of my code
since updating the field/REF/Bookmark/etc should automatically
replace everything?
b) or should I loop through all my sections and replace the variable
one by
one? I currently go through all the sections to insert the
autotext, so I
suppose I could just add this command after the autotext is
inserted.
Either way, can you please show me the exact code I have to write to
get
this to work. I mention again its for headers since I read its a
different
approach (probably using ranges, which I still dont understand well)

3) Finally I believe I have to update the fields in some way so that
they
reflect the inserted variable in my word document.
a) is this just one command or another loop through the whole
document since
it is a header?
Can you please show me this code also?

I have been looking through newsgroups since thursday afternoon, and
have
beem trying once thing after the other, and I have not been very lucky.
I always seem to either delete the autotext completely, get a type
mismatch
when trying to assign the variable, or simply acomplish nothing. Its
very
frustrating. I have already ordered a word book from amazon hopefully
that
will help me out in the long run, but I need some help right now.
please....
help!!!!!

By the way, I use word xp and word 2003 in to machines, and this whole
programming thing came up because I am sick and tired of having to
print
out my documents in sections. I want landscape pages to print with
portrait
headers and portrait pages to print normally (with portrait headers).
Like I said, I have resolved everything but this last step..the
variables.
My documents have many continous sections, and I detect and correctly
apply
the right header (a normal one for portrait and a frame based one for
landscape ones). I am soooooo close, yet its been three days going
around in circles
with this.

Thanks in advance for the help you might be able to provide. And
please, give me an example of the exact code, please dont assume that
by saying "use ASK REF fields" (or something similar) I will know what
you are saying...cause I dont.
I have gone through dozens of usenet articles and tried to piece all
this info and have been unsuccesfull. Sorry for asking for so much, but
its late and I am really frustrated.
thanks!!!!!