MS Word Footer replace.

L

Lene Fredborg

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.

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

chazparks

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
 
L

Lene Fredborg

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

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

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