PDA

View Full Version : Alignment not working in Corel VBA



romiljpr
07-21-2021, 06:10 AM
Sub Kramank()
ActiveDocument.BeginCommandGroup "Kramank"
ActiveDocument.Unit = cdrCentimeter


If ActiveShape.Text.IsArtisticText = True Then
Exit Sub
End If


Dim Val As String
Val = InputBox("Width?", "Paragraph Width")
If StrPtr(Val) = False Then Exit Sub


ActiveShape.SetSize Val - 0.1
ActiveShape.Text.Story.Alignment = cdrFullJustifyAlignment
ActiveShape.Text.Story.Tabs.Clear
ActiveShape.Text.Story.Tabs.Add Val - 0.1, cdrTextTabRight
ActiveShape.Text.Story.ParaSpacingBefore = 87
ActiveShape.AlignToPage cdrAlignHCenter


ActiveDocument.EndCommandGroup
End Sub


Here, Alignment to horizontal center of page not working. what wrong here ? please help