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.
Thread starter Similar threads Forum Replies Date
B Cannot run create macros within Outlook 2007 Using Outlook 2
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
W Outlook was in use; when tried to open today it would not open; pop up with info about e-mails with macros; prompted to enable macros, when doing so; Using Outlook 3
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
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 0
C Outlook with Office365 - search across account, by date rate, in multiple folders - how? Using Outlook 1
D Outlook 2010 Outlook in Windows 10 keeps asking for user name and password repeatedly Using Outlook 13
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 5
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
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
B Outlook Calendar not coming down from cloud Using Outlook 2
Terry Sullivan Sender's Name Doesn't Appear in the From Field on Outlook 365/IMAP Using Outlook 2
GregS Outlook 2016 Can I disable the Outlook Outbox? Using Outlook 2
P Outlook pst file is too huge with POP3. How to save more space? Using Outlook 4
D Outlook Contacts Notes Field Photos to Smartphone Using Outlook 0
Paula S. Outlook 2013 won't recognize new password Using Outlook 4
A Backup Email Accounts On OutLook For Mac 2016 (Microsoft 365 subscription version) Using Outlook 0
J Time Zone Issues - Outlook Calendar and Webcal Feed Using Outlook 8
J Are the underlined letters in Outlook Reminders window supposed to work? Using Outlook 0
M Office 2016 Outlook is forgetting passwords Using Outlook 14
G How to add a folder shortcut to outlook quick access toolbar? Using Outlook 6
W Outlook WAS facebook but there is no info for old accounts Using Outlook 0
E Can one still buy Outlook (or Office) 2016? Using Outlook 6
G Add to Outlook Contacts - Point to non-default contacts folder Using Outlook 0
E Outlook view grouping keeps changing Using Outlook 3
Wayne Outlook locks up when opening "Manage Rules & Alerts" Using Outlook 3
G Personal Settings within Outlook Using Outlook 2
M Outlook 2013 reminder email by using Outlook vba Outlook VBA and Custom Forms 2
H Outlook 2019 Certificate error Using Outlook 2
B Outlook 2013 erratically deleting original file that is attached Using Outlook 0
V Outlook Forms: Formatting a Label with 2 different styles Outlook VBA and Custom Forms 1
Similar threads


















































Top