Creating outlook appointments

AndyB63UK

New Member
Joined
Oct 5, 2011
Messages
47
Hi everyone

Is it possible to creat an appointment in someone elses calendar?

My spreadsheet column B contains all the information needed, I just dont know how to do it.

B7 = Date of event
B8 = Name of event
B53 = Get-In Time (Start Time)
B60 = Get-Out time (Finish Time)
B90 = Duty Technician (from a dropdown list)

And thats all that is needed

We are being upgraded to Office 2010

Many thanks in advance
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Not in a position to be able to test any of this so it might not work, but in theory the logic seems sound. It takes the data in cell B90 as the person whose calendar you want to add an appointment in to. This needs to be either the display name, the alias or the email address of this person for .CreateRecipient to work correctly.

Code:
Sub AddAppointmentToOtherCalendar()
Dim outApp As Outlook.Application
Dim outCal As Outlook.Folder
Dim outAppt As Outlook.AppointmentItem
Dim outRec As Outlook.Recipient


    Set outApp = Outlook.Application
    
    On Error GoTo Err
    Set outRec = outApp.Session.CreateRecipient(Range("B90"))
    Set outCal = outApp.Session.GetSharedDefaultFolder(outRec, olFolderCalendar)
    On Error GoTo 0
    
    Set outAppt = outCal.Items.Add
    
    With outAppt
        .Subject = Range("B8")
        .Start = Format(Range("B7") & " " & Range("B53"), "ddddd h:nn AMPM")
        .End = Format(Range("B7") & " " & Range("B60"), "ddddd h:nn AMPM")
        .Save
    End With
    GoTo CleanUp
    


Err:
    MsgBox "No appointment was saved"
    GoTo CleanUp


CleanUp:


Set outAppt = Nothing
Set outCal = Nothing
Set outRec = Nothing
Set outApp = Nothing


End Sub

Hope this helps

Simon
 
Upvote 0

Forum statistics

Threads
1,215,637
Messages
6,125,964
Members
449,276
Latest member
surendra75

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top