Overwrite Date Range in Tables?

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
 
S

Scott

Doug:

Thanks again for your help, but neither of your
suggestions seems to work. I am still getting the same
problem.

I'm going to try starting over in a new template to see if
there is something with the current one that I am working
with.

Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top