View Single Post
  #12  
Old November 19th, 2006, 12:03 AM posted to microsoft.public.word.tables
macropod
external usenet poster
 
Posts: 1,231
Default Losing textbox on table

Hi Jack,
1)In step 2 you create a "Sub Table" that contains both the prev and next
months data"(Pretty clever). Does this appear in a seaprte space on the
page or did you place this within the main calendar table?

I'd be inclined to put it on the page as a separate table. All this implies
is that there'll be at least one paragraph mark separating the 'main' and
'sub' tables. If the tables are the same overall width, you could delete the
intervening paragraph mark(s) to join the tables afterwards.

2)You store the days for each month in an array. What is the code to

place
the contents of the array into a selection of cells in the table?


Somehting like:
Option Explicit

Sub TestTable()
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim ThisMonth(5, 7)
For j = 1 To 7
For k = 1 To 5
ThisMonth(k, j) = 5 * (j - 1) + k
Next
Next
With ActiveDocument.Tables(1)
For j = 1 To 7
.Cell(1, j).Range.Text = ThisMonth(1, j)
.Cell(2, j).Range.Text = ThisMonth(2, j)
.Cell(3, j).Range.Text = ThisMonth(3, j)
.Cell(4, j).Range.Text = ThisMonth(4, j)
.Cell(5, j).Range.Text = ThisMonth(5, j)
Next
End With
End Sub
No need for a Selection as such - simply specify the table.

Cheers

--
macropod
[MVP - Microsoft Word]