S
Scott
I received some great help from Doug Robbins regarding
entering a date range into a table (See post "Is it
possible to insert a date range into a Table?" July 22)
However, when running the macro (listed below), the date
range does not clear before the next range is inserted.
What happens is that for some dates, you get an 'overlap':
Example: I printed off tables for July 24 and 25. Table
1 is perfect (Thursday, July 25, 2003). Table 2 prints
off showing Friday, July 25, 20033.
Is there a way to clear the field before the macro is run
for the subsequent 'prints' so that this problem doesn't
happen? Perhaps sizing of the cell is to blame??
Suggestions??
Private Sub Document_New()
Dim StartDate As Date, numforms As Double, i As Integer
StartDate = InputBox("Enter the Start Date in MM/dd/yyyy
format", "Start Date", Format(Date, "MM/dd/yyyy"))
numforms = InputBox("Enter the Number of days to Print the
Room Booking Sheets for", "Number Forms", 1)
For i = 0 To numforms - 1
ActiveDocument.Tables(1).Cell(1, 1).Range.Text = Format
(DateAdd("d", i, StartDate), "dddd, MMMM dd, yyyy")
ActiveDocument.PrintOut
Next i
End Sub
TIA
Scott
entering a date range into a table (See post "Is it
possible to insert a date range into a Table?" July 22)
However, when running the macro (listed below), the date
range does not clear before the next range is inserted.
What happens is that for some dates, you get an 'overlap':
Example: I printed off tables for July 24 and 25. Table
1 is perfect (Thursday, July 25, 2003). Table 2 prints
off showing Friday, July 25, 20033.
Is there a way to clear the field before the macro is run
for the subsequent 'prints' so that this problem doesn't
happen? Perhaps sizing of the cell is to blame??
Suggestions??
Private Sub Document_New()
Dim StartDate As Date, numforms As Double, i As Integer
StartDate = InputBox("Enter the Start Date in MM/dd/yyyy
format", "Start Date", Format(Date, "MM/dd/yyyy"))
numforms = InputBox("Enter the Number of days to Print the
Room Booking Sheets for", "Number Forms", 1)
For i = 0 To numforms - 1
ActiveDocument.Tables(1).Cell(1, 1).Range.Text = Format
(DateAdd("d", i, StartDate), "dddd, MMMM dd, yyyy")
ActiveDocument.PrintOut
Next i
End Sub
TIA
Scott