Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

add one line at the end of a footer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
4tis - 01 Oct 2006 22:36 GMT
hi
i need to add a new line (with some text) to the end of the footer in
word (first page and other page).
i need to add this line without changing the formating of the footer (i
have a table in the footer)
i tried some things and nothing worked
how can i do this ?
Doug Robbins - Word MVP - 02 Oct 2006 04:40 GMT
I am assuming that you want to use VBA to do this.

I would insert a { DOCVARIABLE varname } field in the footer where you want
the information to appear and then use

Dim i as Long
With ActiveDocument
   .Variables("varname").Value = "Your line of text"
   For i = 1 to .Sections.Count
       .Sections(i).Footers(wdHeaderFooterFirstPage).Range.Fields.Update
       .Sections(i).Footers(wdHeaderFooterPrimary).Range.Fields.Update
   Next i
End With

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> hi
> i need to add a new line (with some text) to the end of the footer in
[quoted text clipped - 3 lines]
> i tried some things and nothing worked
> how can i do this ?
4tis - 13 Oct 2006 20:16 GMT
thanks
and how can i add this { DOCVARIABLE varname } to the footer via VBA
code and find if it exist ?
i dont have any clew with this variable but it seems that this is
exactly what i am looking for
thanks
4tis - 13 Oct 2006 20:16 GMT
thanks
and how can i add this { DOCVARIABLE varname } to the footer via VBA
code and find if it exist ?
i dont have any clew with this variable but it seems that this is
exactly what i am looking for
thanks
Doug Robbins - Word MVP - 14 Oct 2006 08:02 GMT
Insert the field in the template manually from the Insert>Field menu or by
pressing Ctrl+F9 to insert a pair of field delimiters and typing the
DOCVARIABLE varname inside them and then using Alt+F9 to toggle off the
display of the field codes.  Then when the macro is run, the information
that is stored in the variable by the code in the macro will be displayed

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> thanks
> and how can i add this { DOCVARIABLE varname } to the footer via VBA
> code and find if it exist ?
> i dont have any clew with this variable but it seems that this is
> exactly what i am looking for
> thanks
4tis - 14 Oct 2006 23:39 GMT
thanks
it was realy helping
this is exactly what i was needed
i just did not knew about fields in word
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.