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 / December 2007

Tip: Looking for answers? Try searching our database.

MS Word Footer replace.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chazparks - 13 Dec 2007 16:52 GMT
From a macro, how do I change the footer and margin to
Footer = .5"
Margin = .7"
Lene Fredborg - 13 Dec 2007 18:55 GMT
I am not sure exactly what you refer to with "Footer" and "Margin". If it is
the "From edge" value of the footer and the bottom margin, the following code
will do what you want:

   With ActiveDocument.PageSetup
       .FooterDistance = InchesToPoints(0.5)
       .BottomMargin = InchesToPoints(0.7)
   End With

The other margins are TopMargin, LeftMargin and RightMargin.

Signature

Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word

> From a macro, how do I change the footer and margin to
> Footer = .5"
> Margin = .7"
chazparks - 17 Dec 2007 17:49 GMT
Would it be

With ActiveName.PageSetup
        .FooterDistance = InchesToPoints(0.5)
        .BottomMargin = InchesToPoints(0.7)
End With

using this syntax?
Set CurrentDoc = Application.Documents.Open(TargetFolder & "\" &
FNames(FNix), , False)
       ActiveName = CurrentDoc.Name

> I am not sure exactly what you refer to with "Footer" and "Margin". If it is
> the "From edge" value of the footer and the bottom margin, the following code
[quoted text clipped - 10 lines]
> > Footer = .5"
> > Margin = .7"
Lene Fredborg - 17 Dec 2007 18:13 GMT
No – because:
ActiveDocument is a Document.
CurrentDoc is a Document.
But ActiveName is a String.

The following will work (if "TargetFolder & "\" &
FNames(FNix)" is the full name of an existing document):

Dim CurrentDoc as Document

Set CurrentDoc = Application.Documents.Open(TargetFolder & "\" &
FNames(FNix), , False)

With CurrentDoc.PageSetup
   .FooterDistance = InchesToPoints(0.5)
   .BottomMargin = InchesToPoints(0.7)
End With

Tip: If you use the Option Explicit statement in all modules, it will help
you find errors in your code. See:
"Why variables should be declared properly" at:
http://www.word.mvps.org/FAQs/MacrosVBA/DeclareVariables.htm

Signature

Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word

> Would it be
>
[quoted text clipped - 22 lines]
> > > Footer = .5"
> > > Margin = .7"
 
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.