Results 1 to 2 of 2
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    range has table-doesnt format next line after tabl (W97)

    HIya

    In my word document I have defined the footer as a range.
    The footer range contains 8 lines.

    For line 6 - I would like to apply paragraph formatting
    no spacing after
    however doesnt apply the paragraph format.

    Line 5 contains a table with 6 cells/columns.

    After I run the code...
    the result is the 2nd cell in my table has the paragraph formatting no spacing after applied.
    why is that/
    please find my code below.
    TIA - regards Diana


    Private Function FooterInsertFirstPage()
    'redefine range to only include 1st paragraph
    Set rngFooter = rngFooter.Paragraphs(1).Range

    'insert the autotext entry name in paragraph
    rngFooter.InsertBefore strFooter1stPage
    rngFooter.Select
    rngFooter.InsertAutotext

    'redefine range
    Set rngFooter = ActiveDocument.Sections(x).Footers(wdHeaderFooterF irstPage).Range

    'if company is validate if a table exists in
    'FooterRange if table exist reformat table
    'as required due to overlay files & fax/letter template margins set up differently
    If (gsCompanyName = "ABC") Or (gsCompanyName = "XYZ") Then

    'for some reason when autotext entry inserted inserts
    '6th paragraph formatting - format after 12pts
    'set range & clear paragraph formatting
    Set paraRange = rngFooter.Paragraphs(6).Range
    'Set paraRange = rngFooter.Paragraphs(11).Range
    With paraRange.ParagraphFormat
    .SpaceAfter = 0
    End With
    End If

    '...........other code
    End Function

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: range has table-doesnt format next line after tabl (W97)

    Diana,

    Each cell in the table which has been inserted counts as a separate paragraph, so the code is working as requested by acting on the 6th paragraph in the footer range. Just adjust the count up to compensate for the extra paragraphs which the table introduces (as you've done in the commented out statement).

    Gary

Posting Permissions

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