Consulting

Results 1 to 2 of 2

Thread: Changing tab position after copying from Word to Publisher

  1. #1
    VBAX Regular
    Joined
    Jan 2018
    Posts
    58
    Location

    Changing tab position after copying from Word to Publisher

    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

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    That only suggests one of the files is configured for RTL language but the other is configured for LTR language.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •