Log in

View Full Version : Changing tab position after copying from Word to Publisher



dagerr
04-20-2018, 04:32 AM
Hi,
The following code works properly in Word, but while I'm copying converted text by this code, from Word to Publisher in some reason tab position has changing. Second And third are on left position instead of right.
Thanks




Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
Do While .Execute(FindText:="RAMKA", MatchWholeWord:=True)
oRng.End = ActiveDocument.Range.End
If oRng.Paragraphs.Count > 1 Then
oRng.Start = oRng.Paragraphs(2).Range.Start
oRng.Select


End If
With oRng
.Font.Name = "Arial Narrow"
.Font.Size = 8
With .ParagraphFormat
.LeftIndent = CentimetersToPoints(0)
.RightIndent = CentimetersToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceMultiple
.LineSpacing = LinesToPoints(0.9)
.Alignment = wdAlignParagraphJustify
.WidowControl = True
.KeepWithNext = False
.KeepTogether = False
.PageBreakBefore = False
.NoLineNumber = False
.Hyphenation = True
.FirstLineIndent = CentimetersToPoints(0)
.OutlineLevel = wdOutlineLevelBodyText
.CharacterUnitLeftIndent = 0
.CharacterUnitRightIndent = 0
.CharacterUnitFirstLineIndent = 0
.LineUnitBefore = 0
.LineUnitAfter = 0
.MirrorIndents = False
.TextboxTightWrap = wdTightNone
.TabStops.ClearAll
.TabStops.Add Position:=CentimetersToPoints(3), _
Alignment:=wdAlignTabRight, Leader:=wdTabLeaderSpaces
.TabStops.Add Position:=CentimetersToPoints(3.3), _
Alignment:=wdAlignTabRight, Leader:=wdTabLeaderSpaces
.TabStops.Add Position:=CentimetersToPoints(3.88), _
Alignment:=wdAlignTabRight, Leader:=wdTabLeaderSpaces
End With
End With
Exit Do
Loop
End With
lbl_Exit:
Set oRng = Nothing
End Sub

macropod
04-22-2018, 05:24 PM
That only suggests one of the files is configured for RTL language but the other is configured for LTR language.