Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
automatically number a table in word document
The code below opens the correct document but now I would like to number the
cells in the table. The document has 2 tables both with 2 columns in them. I would like to automatically number the cells in table column 1 of table 2. Any help is very much appreciated. Thank you Dim appWD As Word.Application Set appWD = CreateObject("Word.Application") appWD.Documents.Open ("C:\Microsoft Office Datafiles\Word\DailyNotes\DailyNotes " & strDate & ".doc") appWD.Visible = True |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
automatically number a table in word document
Modify the filename to suit...
Dim appWD As Word.Application Dim docWD As Word.Document Set appWD = CreateObject("Word.Application") Set docWD = appWD.Documents.Open("d:\New.doc") appWD.Visible = True For intRow = 1 To docWD.Tables(2).Rows.Count docWD.Tables(2).Cell(intRow, 1).Range.Text = intRow Next -- Jacob (MVP - Excel) "VinceW" wrote: The code below opens the correct document but now I would like to number the cells in the table. The document has 2 tables both with 2 columns in them. I would like to automatically number the cells in table column 1 of table 2. Any help is very much appreciated. Thank you Dim appWD As Word.Application Set appWD = CreateObject("Word.Application") appWD.Documents.Open ("C:\Microsoft Office Datafiles\Word\DailyNotes\DailyNotes " & strDate & ".doc") appWD.Visible = True |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
automatically number a table in word document
Thank you very much works perfectly.
How about 1 more question for you. I would like to be able to copy the information from table 2 (column 2) of document 1, without actually opening the document, and then paste it into table 2 of this same document. Is that possible? Thanks again in advance. "Jacob Skaria" wrote: Modify the filename to suit... Dim appWD As Word.Application Dim docWD As Word.Document Set appWD = CreateObject("Word.Application") Set docWD = appWD.Documents.Open("d:\New.doc") appWD.Visible = True For intRow = 1 To docWD.Tables(2).Rows.Count docWD.Tables(2).Cell(intRow, 1).Range.Text = intRow Next -- Jacob (MVP - Excel) "VinceW" wrote: The code below opens the correct document but now I would like to number the cells in the table. The document has 2 tables both with 2 columns in them. I would like to automatically number the cells in table column 1 of table 2. Any help is very much appreciated. Thank you Dim appWD As Word.Application Set appWD = CreateObject("Word.Application") appWD.Documents.Open ("C:\Microsoft Office Datafiles\Word\DailyNotes\DailyNotes " & strDate & ".doc") appWD.Visible = True |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
transfer data to fill a word document to print (automatically) | Excel Discussion (Misc queries) | |||
How do I convert a word table into an excel document? | New Users to Excel | |||
table into Word Document | Excel Discussion (Misc queries) | |||
How to automatically number a new document(Invoice) when opening | Excel Discussion (Misc queries) | |||
How to automatically number a new document(Invoice) when opening | Excel Discussion (Misc queries) |