Create Outlook Event on non-default Calendar

bru_giusti

New Member
Joined
Mar 11, 2015
Messages
1
Dear,

I am using the code below to create events on my own calendar but I need to the events be create and sent my my secondary email. Can you help me to change the code so my secondary email and calendar are used when creating the event?

Code:
Sub SendEvent()


  Dim myoutlook As Object ' Outlook.Application
  Dim r As Long
  Dim myapt As Object ' Outlook.AppointmentItem
  'Dim Ns As Outlook.Namespace
 
 
  Const olAppointmentItem = 1
  Const olBusy = 2
  Const olMeeting = 1


  ' Create the Outlook session
  Set myoutlook = CreateObject("Outlook.Application")
  ' Start at active cell
  r = ActiveCell.Row
  
  ' Create the AppointmentItem
    Set myapt = myoutlook.CreateItem(olAppointmentItem)
    ' Set the appointment properties
    With myapt
           
      .Subject = "Application Confirmation - GON:" & Cells(r, 2).Value
      .Location = Cells(r, 18).Value
      .Start = Cells(r, 4).Value
      .End = Cells(r, 5).Value
      .Recipients.Add Cells(r, 28).Value
      .MeetingStatus = olMeeting
      .BusyStatus = olBusy
      .AllDayEvent = True
      .Body = Cells(r, 11).Value
      .Display
         
      
      End With
    End Sub
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,214,911
Messages
6,122,194
Members
449,072
Latest member
DW Draft

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