Results 1 to 3 of 3

Thread: add tablerow in MS word [solved]

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62

    add tablerow in MS word [solved]

    Greetings.

    I got a template in Word that contains a table.
    When I put text into the table I do...
    word_document_explaination.Range(loc1, loc2).InsertBefore(text)

    Is there a way to add an row to the table?
    If so. How?
    Thanks.
    Last edited by Iceman5; Oct 9th, 2003 at 08:23 AM.
    //Martin Andersson

  2. #2
    Addicted Member
    Join Date
    Mar 2001
    Location
    Devon, UK
    Posts
    181
    grab a refernce to the table (tables.item(tablenumber)) and use .rows.add
    Use a counter to keep track of which row you are on

    Dim wdAdvice As New Word.Document()
    With wdAdvice.Tables.Item(5)
    .Cell(RowNumber, ColumnNumber).Range.Text = Date.Now.ToShortDateString
    .Cell(iCurrentRow, 1).Range.Paragraphs.PageBreakBefore = CType(True, Int32)
    .Rows.Add()
    End With
    Wind and waves resolves all problems.

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    Haven´t got time until now to try it and it works great.
    Thanks alot.
    *bows*
    //Martin Andersson

Posting Permissions

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



Click Here to Expand Forum to Full Width