View Single Post
  #13   Report Post  
Posted to microsoft.public.word.tables
Jack Jack is offline
external usenet poster
 
Posts: 9
Default Losing textbox on table

Thanks macropod. I will try this code. I have worked with arrays and so I
follow what you did. I still would have liked to get the submonths table
into the actual month calendar in one of the cells. But this is a great
alternative
Thanks for all your help
Jack
"macropod" wrote in message
...
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]