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 / June 2007

Tip: Looking for answers? Try searching our database.

Marking events in Word Calendar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vrk1 - 17 Jun 2007 16:28 GMT
Hi,

I have a text file that has information as follows:

Start Date  End Date  Event name
1/1/2007    1/5/2007  Inauguration ceremony
2/5/2007    2/9/2007  Camping
2/15/2007  2/16/2007 All employee meeting
.......

I want to create a program in Word that would read this text file and mark
these events in a Word Calendar for the year (created using the standard
Calendar template).  For instance, there should be a bar marked from 1/1/2007
to 1/5/2007 in yellow color with the Event name.  I need to do this for all
the rows in the Text file.

I am sure someone would have done this before.  Can someone give me an idea
of how to achieve a solution programatically please?
alborg - 18 Jun 2007 10:21 GMT
You can probably do that with the calendar control and vba, but it's more
work than it's worth. I tried it once, and after several days just gave up.

The best route to achieve what you are trying to do is to Google "ActiveX
Calendar control". One such control costs only $60 per developer and can be
found here:

http://www.viscomsoft.com/products/calendar/

Cheers,
Al

> Hi,
>
[quoted text clipped - 14 lines]
> I am sure someone would have done this before.  Can someone give me an idea
> of how to achieve a solution programatically please?
Graham Mayor - 18 Jun 2007 11:45 GMT
Another possibility is to use Outlook to store your data. Convert your data
list to a three column table
(http://www.gmayor.com/convert_labels_into_mail_merge.htm ) then run the
following macro to import that data table into Outlook's calendar
http://www.gmayor.com/installing_macro.htm  You can then print a calendar
from Outlook.

Sub AddApptmnt()
Dim ol As New Outlook.Application
Dim ci As AppointmentItem
Dim ctable As Table
Dim i As Long
Dim strStartDate As Range
Dim strEndDate As Range
Dim strSubject As Range

Set ctable = ActiveDocument.Tables(1)
For i = 2 To ctable.Rows.Count
   Set strStartDate = ctable.Cell(i, 1).Range
   strStartDate.End = strStartDate.End - 1
   Set strEndDate = ctable.Cell(i, 2).Range
   strEndDate.End = strEndDate.End - 1
   Set strSubject = ctable.Cell(i, 3).Range
   strSubject.End = strSubject.End - 1
Set ci = ol.CreateItem(olAppointmentItem)
   ci.Start = strStartDate
   ci.End = strEndDate
   ci.ReminderSet = False
   ci.AllDayEvent = True
   ci.Subject = strSubject
   ci.Categories = "Events"
   ci.BusyStatus = olFree
   ci.Save
   Set ol = Nothing
Next i
End Sub

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Hi,
>
[quoted text clipped - 14 lines]
> I am sure someone would have done this before.  Can someone give me
> an idea of how to achieve a solution programatically please?
 
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.