Outlook macros to create meeting on shared calendar

Status
Not open for further replies.

djsupersain

New Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
Hi Guys,

Thanks for having me here..

I'm very new to this all and have followed some online guides to customize a "Meeting Form" and create a "Button" on the outlook ribbon allowing me to book jobs. Myself and a work colleague each have independent email addresses on the office365 exchange (we use outlook 2016) and intern also our own calendars.

I have shared my calendar with my work colleague and have also setup the same form and button on his machine, but everytime he books a job it books to his calendar, at this stage i can only see his booked jobs by sharing his calendar and "Overlaying" with mine so we don't get any conflicting bookings.

Below is the macro code I used, but what can I add to have it book the jobs on "my calendar" that i have shared with him please.

Sub MakeItem()
Set newItem = Application.CreateItemFromTemplate("C:\Users\user\AppData\Roaming\Microsoft\Templates\test.oft")
newItem.Display
Set newItem = Nothing
End Sub

Thank you so much in advance.
 

djsupersain

New Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
Hi and thank you for such a quick reply, yes I have set him up as a owner on my calendar.
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
CreateItem`adds the item to the default calendar, which for your collegue is not yours. Call GetSharedDefaultFolder, and move the item to that folder. See a sample for how to use that function in the VBA help file.
 

djsupersain

New Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
Hi Michael thank you for your reply.. very new to this and don't fully understand vb yet but am determined to learn... will the following work ?

Sub MakeItem()
Set CalendarFolder = GetSharedDefaultFolder(me@me.com, FolderType)
Set newItem = Application.CreateItemFromTemplate("C:\Users\user\AppData\Roaming\Microsoft\Templates\test.oft")
newItem.Display
Set newItem = Nothing
End Sub
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
The email address must be enclosed in quotation marks.
And you need to move the item to the target folder, that is after loading the template call:
set newitem=newitem.move(calendarfolder)
 

djsupersain

New Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
Hi Michael, thank you again.. so the correct code would be like the following?

Sub MakeItem()
Set CalendarFolder = GetSharedDefaultFolder("me@me.com, FolderType")
Set newItem = Application.CreateItemFromTemplate("C:\Users\user\AppData\Roaming\Microsoft\Templates\test.oft")
newItem.Display
Set newItem = newitem.move(calendarfolder)
End Sub
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Only the address is in quotation marks. For FolderType you need to specify which type of folder should be opened: place the cursor onto the word 'FolderType', press ctrl+switch+j, then select the type you need.

Also, move the item before you display it.
 

djsupersain

New Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
Thank you for all your help... slight change in plan, have since created a public folder calendar... please if you could assist in the code below, so now im wanting my macro to create the appointment on the public folder calendar...

Sub MakeItem()
Set CalendarFolder = olPublicFoldersAllPublicFolders(TEST, "TEST@TEST.COM" \ TEST_CALENDAR)
Set newItem = Application.CreateItemFromTemplate("C:\Users\user\AppData\Roaming\Microsoft\Templates\test.oft")
newItem.Display
Set newItem = Nothing
End Sub
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
Press ctrl+6 in Outlook and look at the hierarchy of folders and their names. You´ll find the same hierarchy in Application.Session.Folders("[here the topfolder name]".Folders("[here the subfolder name]")
 

djsupersain

New Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
Apologies for the delay in coming back to you, please are you able to assist with how my macro should be? it just can't seem to get it... can you confirm the below ? and if you can suggest any online courses to learning VB that would be greatly appreciated!

Sub MakeItem()
Set CalendarFolder = Application.Session.Folders("[here the topfolder name]".Folders("[here the subfolder name]")
Set newItem = Application.CreateItemFromTemplate("C:\Users\user\AppData\Roaming\Microsoft\Templates\test.oft")
newItem.Display
Set newItem = Nothing
End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
C Create macros in Outlook 2007 Outlook VBA and Custom Forms 5
J Want to learn VBA Macros for Outlook. What book can you recommend? Outlook VBA and Custom Forms 2
Diane Poremsky Using Arrays in Outlook macros New Slipstick.com Articles 0
Diane Poremsky Running Outlook Macros on a Schedule New Slipstick.com Articles 0
S Using Macros in the Outlook Calendar Using Outlook 2
A Outlook 2010 disabled macros Using Outlook 2
R Outlook Macros for Appointments and Tasks Using Outlook 1
S configuring outlook 2010 through macros Using Outlook 1
L Macros disabled in custom Outlook form Outlook VBA and Custom Forms 1
M macros of outlook 2007 Outlook VBA and Custom Forms 1
S Need: Date handling in Outlook Macros, either information/documentation Outlook VBA and Custom Forms 1
N Copying outlook macros between pcs Outlook VBA and Custom Forms 1
D Macros Disabled in Outlook 2007 BCM (Business Contact Manager) 9
C Outlook macros have vanished Outlook VBA and Custom Forms 1
witzker Open Contact missing in Outlook 2019 Using Outlook 2
D.Moore VB script to Digitaly Sign newly created outlook message Outlook VBA and Custom Forms 2
B Outlook 2016 Retail C2R keeps logging since update? Using Outlook 0
M outlook 365 trying to finish my sentences Using Outlook 0
D Outlook Address Book Using Outlook 0
B Emails get stuck in Outbox of Gmail IMAP in Outlook for Windows Using Outlook 0
C Not sync folders not found after MS Outlook 365 update Using Outlook 1
V Outlook 2016 Does Outlook-2016 (64 bit) work with iCloud for Windows ? Using Outlook 4
R Microsoft Outlook 2016 - Gmail not sending, asks for password for SMTP, tried different ports Using Outlook 23
V Outlook 2016 Outlook-2016 and iCloud for Windows - Problems Using Outlook 2
O VBA Outlook Message Attachment - Array Index Out of Bounds Outlook VBA and Custom Forms 0
K Imap PC Outlook + Android phone Using Outlook 1
GregS Outlook 2016 Move Outlook to new computer? Using Outlook 4
I Outlook 2003 shows html code when To: field is empty Using Outlook 7
O The Outlook API wrongfully shows an outlook folder to have zero sub-folders Outlook VBA and Custom Forms 1
O The Outlook API wrongfully shows an outlook folder to have zero sub-folders Outlook VBA and Custom Forms 2
C All Gmails don't show in Outlook 2019 Using Outlook 3
D Outlook 2007 vs. Outlook 2010 -- ToDo Bar Using Outlook 0
U Outlook 2016 Outlook 2016 sender name Using Outlook 1
T Compuserve, Yahoo, Oath2 and Outlook 2013 Using Outlook 4
E Work uses live accounts for emails for all employees. Can we use the outlook calendar to give the employees an universal work schedule calendar? Using Outlook 1
witzker Macro to move @domain.xx of a Spammail to Blacklist in Outlook 2019 Outlook VBA and Custom Forms 7
D Outlook 2007 on 365 Using Outlook.com accounts in Outlook 2
S Macro for other actions - Outlook 2007 Outlook VBA and Custom Forms 23
P outlook 2008 search box criteria couldn't be saved Using Outlook 2
pcunite Outlook 2019/O365 Build 13127.20408 errors when using MAPI calls Using Outlook 1
C Outlook with Office365 - search across account, by date rate, in multiple folders - how? Using Outlook 2
D Outlook 2010 Outlook in Windows 10 keeps asking for user name and password repeatedly Using Outlook 14
S Outlook mail adressing stops after first match in GAL Using Outlook 0
A Apply Selected Emails to outlook rules and Run Rules Using Outlook 5
T Changing Sent Items location in Outlook 2019 Using Outlook 0
J How do I disable advertising in Outlook 2019? Using Outlook 13
S Outlook (2016 32bit; Gmail IMAP) - Save sent message to Outllook Folder Outlook VBA and Custom Forms 0
L Unable to Sync Web/Android MS To Do with Windows Outlook Tasks Using Outlook 3
S Macro to move “Re:” & “FWD:” email recieved the shared inbox to a subfolder in outlook Outlook VBA and Custom Forms 0
S Outlook Macro to send auto acknowledge mail only to new mails received to a specific shared inbox Outlook VBA and Custom Forms 0

Similar threads

Top