Hello
I have the following code (see code). My question is: Why thedasn't work.It is ignored and the text is all the time Align to the left (Default).oPara1.Range.ParagraphFormat.Alignment = wdAlignParagraphJustify
Thank you
Private Sub CommandButton1_Click() Dim oPara1 As Word.Paragraph 'Start Word and open the document template. Set oWord = CreateObject("Word.Application") oWord.Visible = True Set oDoc = oWord.Documents.Add 'Insert a paragraph at the beginning of the document. Set oPara1 = oDoc.Content.Paragraphs.Add oPara1.Range.ParagraphFormat.Alignment = wdAlignParagraphJustify oPara1.Range.InsertParagraphAfter oPara1.Range.Font.Name = "Trebuchet MS" oPara1.Range.Font.Size = "10" oPara1.Range.Font.Bold = False 'oPara1.Format.SpaceAfter = 5 '5 pt spacing after paragraph. oPara1.Range.Text = "INSERT TEXT that has to be justify ..................." End Sub





Reply With Quote