Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
transfer data to fill a word document to print (automatically) snaggy^^ Excel Discussion (Misc queries) 0 January 19th 06 05:01 PM
How do I convert a word table into an excel document? Aaron New Users to Excel 1 December 22nd 05 03:06 PM
table into Word Document Penny Excel Discussion (Misc queries) 1 October 21st 05 02:26 PM
How to automatically number a new document(Invoice) when opening Gilly Excel Discussion (Misc queries) 1 September 13th 05 03:46 PM
How to automatically number a new document(Invoice) when opening Gilly Excel Discussion (Misc queries) 0 September 13th 05 02:45 PM


All times are GMT +1. The time now is 03:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"