Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
Hi,
I'm trying to create a multi-table doc via a vbscript, with some text between each table (a title effectively). The script I've come up with adds each of the items, but just overwrites the previous item. ie adds the first title, then overwrites with a table, then overwrites that with the next title and so on. I think I'm missing something pretty simple, just to move the selction on, but as usual, it's the simple thing that's proving to be the hardest. My script is listed below for anyone who can help me Thanks. Set objWord = CreateObject("Word.Application") objWord.Visible = True Set objDoc = objWord.Documents.Add() Set objSelection = objWord.Selection objSelection.EndKey wdStory, wdMove 'define table section, including title objSelection.Font.Size = "12" objSelection.TypeParagraph() objSelection.TypeText "title 1" objSelection.TypeParagraph() objSelection.EndKey wdStory, wdMove Set objRange = objDoc.Range() objDoc.Tables.Add objRange, 1,3 Set objTable = objDoc.Tables(1) objTable.AutoFormat(16) Set objSelection = objWord.Selection objSelection.EndKey wdStory, wdMove 'define table section, including title objSelection.Font.Size = "12" objSelection.TypeParagraph() objSelection.TypeText "title2" objSelection.TypeParagraph() objSelection.EndKey wdStory, wdMove Set objRange = objDoc.Range() objDoc.Tables.Add objRange, 1, 4 Set objTable = objDoc.Tables(2) objTable.AutoFormat(6) |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to delete multiple tables? | Tables | |||
Tables setting multiple section breaks with multiple headers | Tables | |||
Create multiple stacked tables in word using vb.net | Tables | |||
Changing format of multiple pre-created tables | Microsoft Word Help | |||
mailmerging multiple tables from access in one word-document: how? | Mailmerge |