code for formatting

S

srinivasan

Hi,
I want a code for formatting a document with the following options. Will any
one guide me with a code for accomplishing this task ?
FONT TAHOMA
FONT SIZE 12
MARGINS LEFT : 3.6 CMS (1.417â€)
TOP : 2 CMS (0.787â€)
RIGHT : 1.7 CMS (0.669â€)
BOTTOM : 1.76 CMS (0.693â€)
Paragraph spacing 1.5 JUSTIFIED

Thank you in advance
 
H

Helmut Weber

Hi Srinivasan,

learn about the macro recorder. See:

http://word.mvps.org/faqs/macrosvba/UsingRecorder.htm

Learn how to modify a recorded macro. See:

http://word.mvps.org/faqs/macrosvba/ModifyRecordedMacro.htm

You may end up with something like this:

Sub Makro2()
Selection.WholeStory
With Selection.Font
.Name = "Tahoma"
.Size = 12
End With
With ActiveDocument.PageSetup
.TopMargin = CentimetersToPoints(2)
.BottomMargin = CentimetersToPoints(1.76)
.LeftMargin = CentimetersToPoints(3.6)
.RightMargin = CentimetersToPoints(1.7)
End With
With Selection.ParagraphFormat
.LineSpacingRule = wdLineSpace1pt5
.Alignment = wdAlignParagraphLeft
End With
End Sub

Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 
S

srinivasan

Dear Mr Helmut weber,
Thanka lot for the feed back. I have learned a lot thro the referred articles.
 

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