Declare the variable tempTable and then select the first table in the document named Log.doc and assign its Range object to tempTable : Document Table « Word « VBA / Excel / Access / Word






Declare the variable tempTable and then select the first table in the document named Log.doc and assign its Range object to tempTable

 
Sub tableSel()
    Dim tempTable
    Documents("Log.doc").Tables(1).Select
    Set tempTable = Selection.Tables(1).Range
    tempRange.Tables(2).Select
End Sub

 








Related examples in the same category

1.inserts a new, blank, non-autofitting table containing 10 rows and 5 columns at the current position of the insertion point in the active document:
2.Selecting a Table in the active document:
3.Selects the first table in the current selection:
4.Converts the current selection to a five-column table, separating the information at commas.
5.Making Sure the Selection Is within a Table
6.Finding Out Where the Selection Is in the Table
7.Adding a Column to a Table
8.Deleting a Column from a Table
9.Setting the Width of a Column
10.The SetWidth method sets the width of one or more columns and specify how the other columns in the table should change as a result: expression.SetWidth ColumnWidth, RulerStyle
11.The Width property lets you change the width of a column without worrying about the effect on the other columns. Specify the width you want in points-for example:
12.Selecting a Column
13.Adding a Row to a Table
14.Deleting a Row from a Table
15.Setting the Height of One or More Rows
16.Set the Height property of the row or rows in question by specifying the height in points
17.Selecting a Row
18.Inserting a Cell
19.Returning the Text within a Cell
20.Strip off the last two characters when assigning the Text property to a string:
21.Entering Text in a Cell
22.Deleting Cells
23.wdDeleteCellsEntireRow deletes the whole row.
24.wdDeleteCellsShiftLeft moves cells across to the left to fill the gap.
25.wdDeleteCellsShiftUp moves cells up to fill the gap.
26.Deletes the first cell in the first row of the first table in the active document and shifts the other cells in the first row to the left to fill the gap:
27.Selecting a Range of Cells
28.Converting a Table or Rows to Text
29.Use the ConvertToText method with a Table object, a Row object, or a Rows collection: converts only the first row of the selected table to tab-delimited text
30.Convert the first table in the document to text separated by paragraphs
31.wdEndOfRangeColumnNumber returns the number of the column in which the end of the selection or range falls.
32.delete the column in which the range testRange ends if the range is more than one column wide: