View Single Post
  #2  
Old May 21st 09, 05:43 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default GAL.ResolveName issue with REDEMPTION



You might want to improve your error handling as a Debug.Print is useful
only the IDE. For instance, show a message box with the MsgBox function, or
write the error message into a file.

If that's done, you can see what the error message is; and if you use line
numbers and the Erl function, you can also see on which line the error
occurs.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Thu, 21 May 2009 08:02:04 -0700 schrieb AVIS:

Hi,

I have a Visual Basic application which uses REDEMPTION dll (ver

4.5.0.812).
This application updates appointments and tasks, to the EXCHANGE SERVER

and
also sends a mail to the EXCHANGE USER, highlighting the changes to the
appointment and tasks. In one PC, the application creates the

appointments
and tasks, but fails to send a mail to the receipient. Below is the

function
where the execution fails. I feel the failure happens at the

GAL.RESOLVENAME
command. Since, only the executable is installed in the PC where the

problem
occurs, i am not able to point out which statement fails. Can somebody

help
me, to get this issue resolved.

The error message, generated by the below function is

"Object variable or With block variable not set"

Private Function RecipientIsValid(session As Redemption.RDOSession,
RecipientUserId As String) As Boolean

On Error GoTo ErrHandler
Dim oMessage As RDOMail
Dim oRecipient As RDORecipient


Set oMessage = session.GetDefaultFolder(olFolderOutbox).Items.Add
Set oRecipient = oMessage.Recipients.Add(RecipientUserId)
session.AddressBook.GAL.ResolveName (RecipientUserId)

CleanUp:
RecipientIsValid = True
Exit Function

ErrHandler:
If Err.Number = -2147219712 Then ' [Collaboration Data
Objects - [MAPI_E_AMBIGUOUS_RECIP(80040700)]]
GoTo CleanUp
Else
Debug.Print "RecipientIsValid"
Debug.Print Err.Description
End If

End Function

Thanks in advance

Ads