Header and Footer Margins

J

JimS

I have a document that I open up and import data from a Sql Database. I
perform this with VBA code. I make an adjustment to the margins that
changes text entered into the document. It also changes the width of the
headers and footers which is something that I dont want to happen. How do
I keep that from happening with VBA code.
 
A

Anne Troy

It sounds, Jim, like you might need to be adjusting indentation on the
paragraphs instead of adjusting margins. You can't really change the margin
without its header and footer too (or not nearly as easily), so perhaps just
using indentation both left and right would help you.
************
Anne Troy
www.OfficeArticles.com
 
J

JimS

Thanks Anne
I have tried to adjust the indentation but I dont seem to have the correct
adjustment. I am not sure that I really know where to put the indent to
move the data to the desired format. I appreciate any help to get pointed
to the right direction.
Thanks
The original code (snippet) that I am using is as follows:


With ActiveDocument.PageSetup
.LeftMargin = InchesToPoints(1)
.RightMargin = InchesToPoints(1)
End With

With ActiveDocument.Range(Start:=Selection.Start, End:=ActiveDocument. _
Content.End).PageSetup.TextColumns
.SetCount NumColumns:=2
.EvenlySpaced = True
.LineBetween = False
.Width = InchesToPoints(1.75)
.Spacing = InchesToPoints(0.5)
End With

Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft

do while not adoRS.eof

' A blank line.
Selection.TypeParagraph

' print the name
Selection.TypeText StrConv(RTrim(adoRS!NAME_TITLE),
vbProperCase) & "." & " "
Selection.TypeText RTrim(adoRS!FIRST_NAME) & " "
Selection.TypeText " " & RTrim(adoRS!LAST_NAME)
Selection.TypeText " "
Selection.TypeParagraph
loop


It sounds, Jim, like you might need to be adjusting indentation on the
paragraphs instead of adjusting margins. You can't really change the margin
without its header and footer too (or not nearly as easily), so perhaps just
using indentation both left and right would help you.
************
Anne Troy
www.OfficeArticles.com
 
J

Jean-Guy Marcil

JimS was telling us:
JimS nous racontait que :
I have a document that I open up and import data from a Sql Database.
I perform this with VBA code. I make an adjustment to the margins
that changes text entered into the document. It also changes the
width of the headers and footers which is something that I dont want
to happen. How do I keep that from happening with VBA code.

Why can't you adjust the margins and header/footer in the template manually?
Why do you have to do it with code?

Another solution is to put the header/footer stuff in a table with fixed
width or in a textbox that is has its position set to a value that is
relative to the edge of the page.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
C

Charles Kenyon

Try changing the indents on the Header and Footer styles.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

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