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

RE: code for formatting by HelmutWeber

HelmutWeber
Mon Aug 22 07:40:38 CDT 2005

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






Re: code for formatting by Jezebel

Jezebel
Mon Aug 22 07:40:42 CDT 2005

Why can't you simply define the style that way, then apply it?




"srinivasan" <srinivasan@discussions.microsoft.com> wrote in message
news:D945D2E8-9F93-47FC-8D1B-DDB6F0513084@microsoft.com...
> 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
>



RE: code for formatting by srinivasan

srinivasan
Mon Aug 22 08:10:06 CDT 2005

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