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

Tip: Looking for answers? Try searching our database.

Example: How do I set up a repeating meeting in Outlook?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
widgitkid - 17 Dec 2007 22:42 GMT
wdeffgmjhgfred
Graham Mayor - 18 Dec 2007 08:30 GMT
Given that this is a Word vba group I assume that you mean from a Word
document?

Dim ol As New Outlook.Application
Dim ci As AppointmentItem
Dim strDate As String
Dim strTime As String
Dim strDocName As String
Dim intPos As Integer
Dim datOutlookDate As Date

strDate = Date
strTime = Format((Time), "hh:mm")
datOutlookDate = CDate(strDate & " " & strTime)

'Find position of extension in filename
strDocName = ActiveDocument.Name
intPos = InStrRev(strDocName, ".")
If intPos = 0 Then

   'If the document has not yet been saved
   'Ask the user to provide a filename
   strDocName = InputBox("Please enter the name " & _
   "of your document in the format filename.doc", "Document not yet saved")
   'Save file with new extension
   ActiveDocument.SaveAs FileName:=strDocName, _
   FileFormat:=wdFormatDocument0
End If
strDocName = Left(strDocName, intPos - 1)

Set ci = ol.CreateItem(olAppointmentItem)
   ci.start = strDate
   ci.ReminderSet = False
   ci.AllDayEvent = True
   ci.Subject = strDocName
   ci.Location = InputBox("Location?")
   ci.Categories = InputBox("Category?")
   ci.Body = InputBox("Body Text?")
   ci.BusyStatus = olFree
   ci.GetRecurrencePattern.RecurrenceType = olRecursMonthly
   ci.Save
   Set ol = Nothing
End Sub

Signature

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

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


Rate this thread:






 
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.