Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
Create multiple stacked tables in word using vb.net
Hello everyone, I am glad I found you!
Here is what I am using: Word ver 2002 OS XP VB.Net In vb.net I need to find a certain location in a Word template, then add multiple tables fed from a dataset with a line in between each table containing descriptive text. I have tried creating bookmarks on the fly and adding a table to each bookmark without much success especially in where and how they appear. The tables need to be stacked so to speak on top of one another with a descriptive line of text in between each table. One of the main problems I have is in determining how to create the bookmark locations to be one after the other(possibly with a space in between). Maybe bookmarks are not the way to go. Thanks in advance for any response. |
#2
Posted to microsoft.public.word.tables
|
|||
|
|||
Create multiple stacked tables in word using vb.net
Hi ?B?SmVubnkgQmVhdmVycw==?=,
Hello everyone, I am glad I found you! Well, still not *quite* the right place (an office.developer group would be better; this group caters to end-users), but definitely a good place to start :-) Basically, you have to proceed like this: 1. Find the starting point (for the first table). Note: you should be working with RANGES, not SELECTION objects. 2. Insert the first table, roughly: Dim tbl As Word.Table = rng.Tables.Add 'Parameters here 'Populate and format the table 3. Now move the position outside the table, using a range Dim rngTbl =tbl.Range rngTbl.Collapse wdCollapseEnd 'This is just below the table rngTbl.Text = "Text between the tables" & vbCR rngTbl.Collapse wdCollapseEnd tbl = Nothing tbl = rngTbl.Tables.Add 'etc. Here is what I am using: Word ver 2002 OS XP VB.Net In vb.net I need to find a certain location in a Word template, then add multiple tables fed from a dataset with a line in between each table containing descriptive text. I have tried creating bookmarks on the fly and adding a table to each bookmark without much success especially in where and how they appear. The tables need to be stacked so to speak on top of one another with a descriptive line of text in between each table. One of the main problems I have is in determining how to create the bookmark locations to be one after the other(possibly with a space in between). Maybe bookmarks are not the way to go. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
#3
Posted to microsoft.public.word.tables
|
|||
|
|||
Create multiple stacked tables in word using vb.net
Cindy,
Thank you for your response, your example is very clear and helpful. Also, I am sorry for posting In the wrong area. "Cindy M -WordMVP-" wrote: Hi ?B?SmVubnkgQmVhdmVycw==?=, Hello everyone, I am glad I found you! Well, still not *quite* the right place (an office.developer group would be better; this group caters to end-users), but definitely a good place to start :-) Basically, you have to proceed like this: 1. Find the starting point (for the first table). Note: you should be working with RANGES, not SELECTION objects. 2. Insert the first table, roughly: Dim tbl As Word.Table = rng.Tables.Add 'Parameters here 'Populate and format the table 3. Now move the position outside the table, using a range Dim rngTbl =tbl.Range rngTbl.Collapse wdCollapseEnd 'This is just below the table rngTbl.Text = "Text between the tables" & vbCR rngTbl.Collapse wdCollapseEnd tbl = Nothing tbl = rngTbl.Tables.Add 'etc. Here is what I am using: Word ver 2002 OS XP VB.Net In vb.net I need to find a certain location in a Word template, then add multiple tables fed from a dataset with a line in between each table containing descriptive text. I have tried creating bookmarks on the fly and adding a table to each bookmark without much success especially in where and how they appear. The tables need to be stacked so to speak on top of one another with a descriptive line of text in between each table. One of the main problems I have is in determining how to create the bookmark locations to be one after the other(possibly with a space in between). Maybe bookmarks are not the way to go. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
apply a template to existing documents | Page Layout | |||
Word2000 letterhead merge | Mailmerge | |||
is word perfect compatible with office word? | Microsoft Word Help | |||
In Word, how can I see all files (*.*) in "save as"? | New Users | |||
Continuous breaks convert to next page breaks | Microsoft Word Help |