PDA

View Full Version : OL2010 - Macro to insert text into the Location field of a Meeting Invite



Nebulous
01-20-2016, 03:11 PM
I need a macro that will insert specified text into the location field of a meeting invitation. The purpose is for conference call meeting invites. The macro would insert the call-in nuber and attendee access code for me.

For your example, you can use the following text:
CALL: 800-555-1212 / CODE: 9879876

I am not a developer or programmer. I do know how to use and sometimes tweak other peoples' VBA code, though - but just the basics. Until now, I've never toyed with macros in Outlook, however.

I'm guessing this is pretty easy to do. I figured out a way to insert text into the body of the meeting invite, but I'm having trouble tweaking it to put the text into the Location field instead.

Thanks in advance for your help!

~N

Nebulous
01-22-2016, 04:50 AM
Bump?

gmayor
01-22-2016, 06:53 AM
Have you looked at https://msdn.microsoft.com/en-us/library/office/ff861308.aspx?f=255&MSPPError=-2147217396 ?
The location in that macro is

myItem.Location = "The location"

Nebulous
02-08-2016, 11:39 AM
gmayor - I really appreciate the help and apologize for the delay. This is very close to what I want. I stripped it down to the parts I need:


Sub InsertConfCallInfo()
Dim myItem As Object
Set myItem = Application.CreateItem(olAppointmentItem)
myItem.Location = "CALL: (866) 555-1212 / CODE: 9854101812"
myItem.Display
End Sub


The only difference is that this macro creates an new appointment with the data I want in the location field.

Normally, however, I will already have an appointment open and want the text inserted there.

How would I accomplish this with a new appointment that is currently in focus?

~N

gmayor
02-08-2016, 11:39 PM
If you want to work with the currently open item you need to use the following
Option Explicit
Sub InsertConfCallInfo()
Dim myItem As AppointmentItem
On Error GoTo lbl_Exit
Set myItem = ActiveInspector.CurrentItem
myItem.Location = "CALL: (866) 555-1212 / CODE: 9854101812"
'myItem.Display 'Not required as the item is already displayed.
lbl_Exit:
Exit Sub
End Sub

Nebulous
02-09-2016, 09:05 AM
gmayor - That did the trick. Thanks so much!

eirajeremy
02-05-2024, 03:59 AM
Hi N,


To accomplish this, you can use a VBA macro in Outlook to insert the specified text into the location field of a meeting invitation. I can help you with the VBA code to achieve this. Let me know if you'd like me to provide the code for you.


Best regards,