Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]() I have got a word document that already contains a table. I need to write a MS word macro to append one more table after the existing table in the same word document.When i write the following code: set oTable = oDoc.Tables.Add(.......) i get the new table overwritten on to the existing table. How can i overcome this problem... Please help!! Thanks in advance -- rahul4real ------------------------------------------------------------------------ rahul4real's Profile: http://www.thecodecage.com/forumz/member.php?userid=377 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=108824 |
#2
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
Dim trange As Range
Dim otable As Table With ActiveDocument Set trange = .Range trange.Collapse wdCollapseEnd Set otable = .Tables.Add(trange, 2, 2) End With or, if you want a space between the two tables Dim trange As Range Dim otable As Table With ActiveDocument .Range.InsertAfter vbCr Set trange = .Range trange.Collapse wdCollapseEnd Set otable = .Tables.Add(trange, 2, 2) End With -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "rahul4real" wrote in message ... I have got a word document that already contains a table. I need to write a MS word macro to append one more table after the existing table in the same word document.When i write the following code: set oTable = oDoc.Tables.Add(.......) i get the new table overwritten on to the existing table. How can i overcome this problem... Please help!! Thanks in advance -- rahul4real ------------------------------------------------------------------------ rahul4real's Profile: http://www.thecodecage.com/forumz/member.php?userid=377 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=108824 |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Word 2002 Appending one document to another. | Page Layout | |||
appending pages to a word file? | Microsoft Word Help | |||
When I highlight text it is appending instead of replacing? | Microsoft Word Help | |||
template appending to merged document | Mailmerge | |||
Appending word documents - Part 2 | Microsoft Word Help |