Calendar free times to a new mail message

I'll need vba code to collect free times from my calendar to a body of a mail message. It should only use times between working hours. There should have start and end date, and it should't collect pastitems.
That maybe can done by vba, but I haven't find code or good add-in.

Outlook 2007 have that, but I only want free times, that's all.

I'll tryed attached code, but it returs info and I don't know howto format it. I allso need info how to get start and end day and only working hours, not just one day.

I's there any things that don't work in differend versions?

Public Sub GetFreeBusyInfo()
Dim myNameSpace As Outlook.NameSpace
Dim myRecipient As Outlook.Recipient
Dim myFBInfo As String

Set myNameSpace = Application.GetNamespace("MAPI")
Set myRecipient = myNameSpace.CreateRecipient("MEKROTH")
On Error GoTo ErrorHandler
myFBInfo = myRecipient.FreeBusy(#2/2/2008#, 60 * 24)
MsgBox myFBInfo
Exit Sub
ErrorHandler:
MsgBox "Cannot access the information. "
End Sub

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories