
August 23rd, 2003, 05:56 AM
|
|
Contributing User
|
|
Join Date: Aug 2003
Location: Singapore
Posts: 34
Time spent in forums: < 1 sec
Reputation Power: 5
|
|
|
May i comment ....
May Be This will Help...
Code:
Dim MyDoc As Word.Application
Dim rTable As Range 'create a range variable
Set MyDoc = New Word.Application
With MyDoc
Visible=True
.Documents.Add "normal.dot", , , True
'If table is at end of contents
Set rTable = .ActiveDocument.Content
'If table is at on a bookmark just select 1 and comment the other
Set rTable = .ActiveDocument.BookMarks("Bookmark").Range
rTable.Collapse Direction:=wdCollapseEnd
'Create The Table with 10 row & 4 column
.ActiveDocument.Tables.Add rTable, 10, 4 'Row=10, Col=4
.ActiveDocument.Tables(1).PreferredWidth = InchesToPoints(10#)
.ActiveDocument.Tables(1).Range.Font.Size = 10
.ActiveDocument.Tables(1).Range.Font.Name = "Arial"
'adjust the column width in inches
.ActiveDocument.Tables(1).Columns(1).Width = InchesToPoints(2#)
.ActiveDocument.Tables(1).Columns(2).Width = InchesToPoints(2#)
.ActiveDocument.Tables(1).Columns(3).Width = InchesToPoints(2#)
.ActiveDocument.Tables(1).Columns(4).Width = InchesToPoints(2#)
.ActiveDocument.Tables(1).Range.Cells(1,1).Range text:="Hey"
__________________
I May Have Misinterpret U'r Post
Correct Me If I Am Wrong......//
Enjoy Coding..........................///
zak2zak
|