how to write in a table in a footer ?

M

MM

Hi all !

I'm looking for a way to write in a table in a footer in vba.
I open my word doc from access and write things in it but i don't know how
to write in a footer.
I'd better not use Shapes and selection because i found it it is not very
reliable.

Thanx for your help !
 
P

Phill. W

.. . .
I'm looking for a way to write in a table in a footer in vba.
i don't know how to ...

MM,

If /you/ don't know how to do something in Word's VBA, ask
/something/ that does - Word!

Word's Macro Recorder is your friend. Use it to record whatever
you want to do, then you can cut and paste the created code
into Access. Well, almost anyway...

HTH,
Phill W.
 
M

martinique

This isn't a task that the macro recorder will handle gracefully. And where
did Access come into this!?
 
M

MM

You're right, the macro recorder generate a crappy code for that kinda
things...
That's why i was asking...
 
M

MM

here is what i eventually use :

With owd.Sections(1).Footers(wdHeaderFooterPrimary).Range.Tables(1)
.Cell(2, 1).Range.Text = rs.Fields(0)
.Cell(2, 2).Range.Text = rs.Fields(1)
.Cell(2, 3).Range.Text = rs.Fields(2)
.Cell(2, 4).Range.Text = rs.Fields(3)
End With
 
M

martinique

Well it might or might not work - at all, or as you intend - depending on
what you're actually trying to do. The macro recorder will always refer to a
*specific* footer (the footer of the page you were on when you recorded the
macro) which will not necessarily be the same as the footer of the page you
are on when you run the macro. If you recorded the macro on the first page
of a document with a different first page footer, then ran it in a document
with only a single footer, it will simply crash.
 

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