LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Macro to create outlook appointment

I have posted a number of questions recently based around this subject. I
have nearly finished but need a couple more things before it is perfect.

My code is as follows:-

Macro 1:-

Sub RunIf()
For Each c In Range("C3:F14")
If c.Value = "A/L" Then
If c.Offset(0, 1).Value = "done" Then
'skip it'
Else
'do it'
Call Add_Appointment
c.Offset(0, 1).Value = "done"
Call Add_Appointment
End If
End If
Next
End Sub


Macro 2 -

Sub Add_Appointment()
Dim myOlapp As Object
Dim myitem As Object

Set myOlapp = CreateObject("Outlook.Application")
Set myitem = myOlapp.createitem(1)

With myitem
.Body = "Annual Leave"
'.Duration = dur'
.AllDayEvent = True
.ReminderSet = False
.Subject = Range("C1").Value & " - A/L"
.Save

End With

Set myitem = Nothing
Set myOlapp = Nothing

End Sub

The last bit of help i need is:-

1) Within the .Subject field in Macro 2 is there a way i can get this to
look at the top field in the column? I may just assign macro 1 to a button
for each column, which may be from 'C' up to 'Z', but instead of creating
mulpitple macro's for each row, can .Subject field be completed automatically?

2) When creating the appointment, the annual leave will be assigned next to
a date, but when running it will only populate all appoinments onto the
current day. How would i set it to cross reference the date field to create
the appointment against the correct date?

3) How can i specify which calender it adds the appointment to? This macro
will be running for a shared calender.

4) How do i stop the entries duplicating in the calender?

Again any answers to the above questions are really appreciated.

Thanks
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
outlook appointment labels colour from excel Brettjg Excel Discussion (Misc queries) 2 March 9th 08 06:00 AM
Adding an Outlook appointment shortcut to the Excel menu Creating a Word shortcut in Excel[_2_] Excel Discussion (Misc queries) 1 December 7th 07 06:33 PM
Pass a time value from Excel to Outlook appointment splodgey Excel Discussion (Misc queries) 2 October 18th 07 11:17 AM
Automatically create outlook appointment Alarmbloke Excel Discussion (Misc queries) 0 March 12th 06 08:47 PM
Create a button in excel that can open an outlook appointment? Movieman Excel Worksheet Functions 1 July 15th 05 12:20 AM


All times are GMT +1. The time now is 10:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"