By default, the “Location” for a Skype for Business (ne Lync) Meeting in an Outlook calender invite reads as “Skype Meeting”. This is not very friendly to mobile users who want to dial in via phone. If the body of the meeting contains a lot of agenda text, the Skype dialin information may not display at all on mobile; and without something in the “Location”, a user can’t just tap the invite to dial in directly.
I wanted to have a Macro that lets me set the “Location” to “phone-number x conference-id#”. This way, the user can dial, and has the conference id available in the dial screen to be sent with one touch.
Further, I wanted to be able to control permissions through the Skype Meeting Options, which means I can’t use a “dedicated meeting space”, but have to use the “new meeting space” option, which means the conference ID changes with every meeting.
I want to hear when people enter or leave, I don’t want anyone to have to wait around in a lobby, and I conference with customers, so I don’t want restrictions as to who can join or present. The screenshot below shows the permissions I chose before hitting “Remember Settings”.
The macro I created is not very smart: The phone number to call is hard-coded, which means you will need to enter your number into the code. If your phone number is not static, then adapting the code to regex the phone number is left as an exercise to you.
In order to use the macro, you’ll need to:
– Enable access to the coding tools in Outlook, the “Developer” toolbar
– Create the macro
– Sign the macro and save
– Link the macro to the “New Appointment” screen
The macro was created for use with Outlook 2010. I expect it will work with newer versions such a 2013 and 2016 as well, but this has not been tested.
Enable access to the coding tools in Outlook
From the Outlook main windows, click on “File” then “Options”
In the “Outlook Options” window, click on “Customize Ribbon” on the left. Check the “Developer” ribbon to show up.
Create the macro
From the Outlook main window, click the “Developer” toolbar, then the “Visual Basic” icon
Right-click the Project name in the left pane, choose “Properties…” and set the “Project Name” to “Skype”, then click OK.
Under “Modules”, you should see a “Module 1″ with an empty window to the right. Click it and paste the code below.
<Edit> Now with code formatting that will paste correctly.
Application.ActiveInspector.CurrentItem.Location = "(xxx)-yyy-zzzz x " & GetValueUsingRegEx() & "#"
Function GetValueUsingRegEx() As String
' Set reference to VB Script library
' Microsoft VBScript Regular Expressions 5.5
Dim olAppt As Outlook.AppointmentItem
Dim Reg1 As RegExp
Dim M1 As MatchCollection
Dim M As Match
Set olAppt = Application.ActiveInspector.CurrentItem
' Debug.Print olAppt.Body
Set Reg1 = New RegExp
' \s* = invisible spaces
' \d* = match digits
' \w* = match alphanumeric
.Pattern = "Conference ID\s*[:]+\s*(\d*)\s*"
.Global = True
If Reg1.test(olAppt.Body) Then
Set M1 = Reg1.Execute(olAppt.Body)
Set M = M1(0)
' Debug.Print M
' Debug.Print M.SubMatches(0)
GetValueUsingRegEx = M.SubMatches(0)
In that code, change (xxx)-yyy-zzzz in the second line to the actual phone number you want to show up in the “Location” of your meeting.
In the Visual Basic editor, click the “Tools” menu, then “References…” and check the “Microsoft VBScript Regular Expressions 5.5″, then click “OK”. This is required for the macro to function.
Here is a screen shot of the VBA editor for reference:
Sign the macro and save
Outlook 2010, by default, has a macro security setting of “Notifications for digitally signed macros, all other macros disabled”. Without signing the macro, it may work the first time around, but you might get an error message that “the macros in this project are disabled” in future.
We’ll create a self-signed cert and apply it. For Outlook 2010 and 2013, look for the “Digital Certificate for VBA Projects” application in the Start menu, give it your name, and click “OK” to create the certificate, like so:
Next, apply this certificate to your project. In the VBA editor, choose the “Tools” menu then “Digital Signature…” and apply the certificate you just created by selecting it via “Choose…” then clicking “OK”:
Lastly, save your Project via “File” and “Save VbaProject.OTM”.
When that is done, you can close the VBA editor screen either via the X in the corner or through the “File” menu.
At some point when first executing the macro, you may see a warning whether to trust the certificate you just created. Choose “Enable Macros” or “Trust all documents from this publisher” :
Link the macro to the “New Appointment” screen
This was actually the least intuitive step of the whole lot.
In Outlook, click on “Calendar”, then “New Skype Meeting”. As far as I can tell, you can only add the macro to the ribbon while in that window.
With that new meeting window open, click “File”, then “Options”.
Click on “Customize Ribbon”
Right-click “Appointment” and choose “Add New Group”
Right-Click the “New Group (Custom)” and rename it to “Skype”
Select “Skype (Custom)” and use the up-arrow to the right to move it just under “Skype Meeting”
With “Skype (Custom)” still selected, change “Choose commands from:” on the left-hand list to “Macros”
Click on the “Skype.AddLocation” macro and use the “Add>>” button
The macro should now show up in your “Skype (Custom)” group.
Click OK and test the macro!
Screenshot of what this ribbon option window looks like below.
This is a
fair serious amount of effort just to get a phone number into the “Location” field. For me, it was worth it because that effort makes life easier for my customers joining my meetings.
If so desired, you can disable the “Developer” toolbar again.