strName = Me.Text28
Set objRecip = objNS.CreateRecipient(strName)
Set objRecip = objNS.CreateRecipient(strName)
If objRecip is Nothing then
MsgBox "You do not have a recipient"
Exit Sub
end if
If Not objRecip.Resolve Then
MsgBox "You have not given a proper email address"
Exit Sub
End If
Set objFolder = objNS.GetSharedDefaultFolder(objRecip, olFolderCalendar)
If Not objFolder Is Nothing Then
Set objAppt = objFolder.Items.add
else
Msgbox "You do not have the right to view this persons calendar"
Exit Sub
end if
I have no idea why. Outlook does not having leaks or objects which are not properly cleaned up. It is one of the few MSOffice / VBA things that is not so forgiving. I thus guess that in your testing you are setting outlook objects and then not cleaning them up.Here's a funny one for you.
I used the code you just sent and it worked lovely, but when I went to use it again I'm getting a error again on this line:
Set objFolder = objNS.GetSharedDefaultFolder(objRecip, olFolderCalendar)
That is up to you to find out. Most likely your field on your form is not correct.Plus strName is now not getting poppulated