Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Could somebody please tell me what command I need to add to this code to Align the text to the Left ?!?

VB
Set WordApp = Nothing
Set WordApp = New Word.Application
WordApp.Visible = True
WordApp.Activate
WordApp.WindowState = wdWindowStateMaximize
WordApp.Documents.Open "K:\Newsletters\Test\Current_Season\ZipFile\Test.rtf" 'myRtfDoc
WordApp.Selection.WholeStory
WordApp.Selection.Font.Name = "Courier New"
WordApp.Selection.Font.Size = 8
WordApp.Selection.PageSetup.LeftMargin = CentimetersToPoints(0.75)
WordApp.Selection.PageSetup.RightMargin = CentimetersToPoints(0.5)
WordApp.Selection.PageSetup.TopMargin = CentimetersToPoints(0.5)
WordApp.Selection.PageSetup.BottomMargin = CentimetersToPoints(0.5)
WordApp.WordBasic.TogglePortrait Tab:=3, PaperSize:=0, TopMargin:="0.75", _
    BottomMargin:="0.5", LeftMargin:="0.5", RightMargin:="0.5", Gutter:="0", _
    PageWidth:="29.7", PageHeight:="21", Orientation:=1, FirstPage:=0, _
    OtherPages:=0, VertAlign:=0, ApplyPropsTo:=0, FacingPages:=0, _
    HeaderDistance:="1.25", FooterDistance:="1.25", SectionStart:=2, _
    OddAndEvenPages:=0, DifferentFirstPage:=0, Endnotes:=0, LineNum:=0, _
    StartingNum:=1, FromText:=wdAutoPosition, CountBy:=0, NumMode:=0, _
    TwoOnOne:=0, GutterPosition:=0, LayoutMode:=0, CharsLine:=50, LinesPage:= _
    45, CharPitch:=220, LinePitch:=360, DocFontName:="+Body", DocFontSize:=11 _
    , PageColumns:=1, TextFlow:=0, FirstPageOnLeft:=0, SectionType:=1, _
    FolioPrint:=0, ReverseFolio:=0, FolioPages:=1
Selection.HomeKey Unit:=wdStory
Posted
Updated 31-Mar-15 11:24am
v2
Comments
ZurdoDev 31-Mar-15 14:24pm    
In Word, you can just record a macro doing what you want and then you can see the code.
Gary Heath 31-Mar-15 15:02pm    
I'd forgotten all about that, I did it and it works perfectly, thanks RyanDev :-) !!!

1 solution

Resolved by RyanDev


RyanDev at 37 mins ago
Reply
In Word, you can just record a macro doing what you want and then you can see the code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900