Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2007

Tip: Looking for answers? Try searching our database.

how to  generate appointment times with 5 minute interval

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
crazyfisher - 24 Sep 2007 04:10 GMT
Dear all,

I want to write a macro to inform the patients about a x-ray scan, and I
wish to write a macro that can automatically generate time(at a 5 minute
interval, from 9 am to 4:55 pm, excluding 12 am-1pm)....

I know how to get the name and address from a file, but I am not sure how to
make the time setting thing working, could anyone help ???

thanks a lot !!
Doug Robbins - Word MVP - 24 Sep 2007 10:05 GMT
I assume that by saying that you know how to get the name and address from a
file, you are using mailmerge.

If the merge source is a table in a Word document, the following code could
be used to populate a column of cells with the time of each approintment:

Dim i As Long
Dim apptable As Table
Set apptable = ActiveDocument.Tables(1)
With apptable
   For i = 0 To 35
       .Cell(i + 2, 1).Range.Text = Format(DateAdd("n", 5 * i, DateAdd("h",
9, 0)), "hh:nn")
   Next i
   For i = 0 To 47
       .Cell(i + 38, 1).Range.Text = Format(DateAdd("n", 5 * i,
DateAdd("h", 13, 0)), "hh:nn")
   Next i
End With

Change te second parameter 1, in the cell reference .Cell(rownum, colnum) to
suit the column into which you want the appointment times to be entered.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Dear all,
>
[quoted text clipped - 7 lines]
>
> thanks a lot !!
crazyfisher - 01 Oct 2007 12:49 GMT
Thanks Doug,

It sounds great to me..

well, if I just input the data from a text fie, is there a way to  use the  
code to generate the timing as well?

Thanks !!

> I assume that by saying that you know how to get the name and address from a
> file, you are using mailmerge.
[quoted text clipped - 30 lines]
> >
> > thanks a lot !!
Doug Robbins - Word MVP - 02 Oct 2007 03:23 GMT
How is the data arranged in the text file?

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Thanks Doug,
>
[quoted text clipped - 46 lines]
>> >
>> > thanks a lot !!
crazyfisher - 09 Oct 2007 00:59 GMT
well, in text file, the arragement of data is" name, address" for example,
first line, John Smith, 2 Lee street
 i am not sure whether text file is a good idea... what do you think?
maybe I should put it to an excel file, with one column is name, the next
one address.

thanks!

> How is the data arranged in the text file?
>
[quoted text clipped - 48 lines]
> >> >
> >> > thanks a lot !!
crazyfisher - 11 Oct 2007 00:59 GMT
In fact, what I want to do is to generate invitation letters to all the
people in the contact list with a different appointment time. the first
person is 9:00Am and the second is 9:05 Am, etc. and at the end, there will
be a bunch of letters.
is it possible ?

> How is the data arranged in the text file?
>
[quoted text clipped - 48 lines]
> >> >
> >> > thanks a lot !!
Doug Robbins - Word MVP - 16 Oct 2007 00:49 GMT
I would open you text file with Word, then convert the information into a
table using the Convert text to table facility on the Table menu, then run
the macro that I gave you and then save that docment and use it as the data
source for your mailmerge.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> In fact, what I want to do is to generate invitation letters to all the
> people in the contact list with a different appointment time. the first
[quoted text clipped - 61 lines]
>> >> >
>> >> > thanks a lot !!
crazyfisher - 16 Oct 2007 04:12 GMT
Thank you very much! it is a great idea and save time too..

> I would open you text file with Word, then convert the information into a
> table using the Convert text to table facility on the Table menu, then run
[quoted text clipped - 66 lines]
> >> >> >
> >> >> > thanks a lot !!
Greg Maxey - 24 Sep 2007 11:43 GMT
I have an Add-In on my website that you can use to generate the seqeuence
time entries in the cells:

http://gregmaxey.mvps.org/Date_Sequencer.htm
Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> Dear all,
>
[quoted text clipped - 6 lines]
>
> thanks a lot !!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.