title: Extending my Outlook VBA code to use Free/Busy and schedule appts
body: <p>I sometimes travel internationally and when I do, I have to meet with 5 to 10 internal collegues. Till now, what I do is use the following code to send out introductions and see when they may be free to meet. I put their first and last names in Excel, as well as whether or not I've met them before.</p>
  
  <pre><code>Sub CreateInvite(lngDuration As Long, strInviteBody As String, strLocation As String, strSubject As String, strRec As String)
  Dim olApp As Outlook.Application
  Dim olMeetingInvite As AppointmentItem
  Set olApp = CreateObject("outlook.application")
  Set olMeetingInvite = olApp.CreateItem(olAppointmentItem)
  With olMeetingInvite
  .Body = strInviteBody
  .Display
  .Recipients.Add strRec
  .Recipients.ResolveAll
  .Subject = strSubject
  .Location = strLocation
  .Duration = lngDuration
  End With
  End Sub
  Sub RunInviteCreator()
  Dim strRec As String
  Dim strRecFirstName As String
  Dim strLoc As String
  Dim xlApp As Excel.Application
  Set xlApp = CreateObject("excel.application")
  Dim xlWS As Excel.Workbook
  Set xlWS = xlApp.Workbooks.Open("C:\Invitees.xls")
  Dim xlSheet As Excel.Worksheet
  Set xlSheet = xlWS.ActiveSheet
  Dim strSubject As String
  Dim strLocation As String
  Dim i As Integer
  Dim iMeetingLength As Integer
  Dim strHour As String
  Dim strMeetingLength As String
  Dim strInviteBody1 As String
  Dim strInviteBody2 As String
  Dim strInviteBody As String
  Dim strKnown As String
  
  For i = 2 To 21
  strRecFirstName = xlSheet.Cells(i, 1)
  strRec = xlSheet.Cells(i, 3)
  strSubject = xlSheet.Cells(i, 6)
  strLocation = xlSheet.Cells(i, 8) &amp; "/" &amp; xlSheet.Cells(i, 9)
  iMeetingLength = xlSheet.Cells(i, 7)
  If iMeetingLength &gt; 60 Then strHour = "hours" Else strHour = "hour"
  strMeetingLength = CStr(iMeetingLength / 60)
  strInviteBody1 = "Dear " &amp; strRecFirstName &amp; "," &amp; vbCrLf
  
  strKnown = "Allow me to introduce myself. I am Mahin from HQ in Boise." &amp; vbCrLf &amp; vbCrLf
  
  strInviteBody2 = _
  "I will be in " &amp; area &amp; "from May 17 to May 23 and would really like to meet with you, learn about your business and see how we can cooperate to drive initiatives in FY10." &amp; vbCrLf &amp; vbCrLf &amp; _
  "I’ve checked your calendar and this looks like a good time. If not, however, please feel free to propose a new time. The best time would be Friday, which I am leaving open to accommodate calendar reschedules. Also, I have booked this for " &amp; strMeetingLength &amp; " " &amp; strHour &amp; ". If you feel the meeting needs to be longer or shorter, please let me know." &amp; vbCrLf &amp; vbCrLf &amp; _
  "I really look forward to meeting you and working with you." &amp; vbCrLf &amp; vbCrLf &amp; _
  "Best Regards," &amp; vbCrLf &amp; vbCrLf &amp; _
  "Mahin" 
  
  If xlSheet.Cells(i, 10) = "Yes" Then
  strInviteBody = strInviteBody1 &amp; strInviteBody2
  Else
  strInviteBody = strInviteBody1 &amp; strKnown &amp; strInviteBody2
  End If
  
  CreateInvite CLng(iMeetingLength), strInviteBody, strLocation, strSubject, strRec
  Next i
  
  End Sub
  </code></pre>
  
  <p>What I'd like to do is to check Exchange's free/busy for all of these people first and then have my program send an invite to their calendar and reference that in the mail above. Can anyone provide me with some pointers on how to do this in Outlook OM? Thx!</p>