MAPIQueryOriginator

Syntax

MAPIQueryOriginator(OrigName$, Address$)

Remarks

Returns the friendly name of the originator of the current inbound message.

Argument

Explanation

OrigName$

The friendly name of the originator of the current inbound message

Address$

The address of the originator of the current inbound message


Example

The following example displays the friendly name and address of the originator of the first message in the Inbox.


Sub MAIN
MAPI_LOGON_UI = 1
Session = MAPILogon(0, "", "", MAPI_LOGON_UI, 0)
Dim MessageID$, Originator$, Address$
result = MAPIFindNext(Session, 0, "", "", 0, 0, MessageID$)
MAPI_ENVELOPE_ONLY = 64
MAPI_PEEK = 128
Flags = MAPI_ENVELOPE_ONLY + MAPI_PEEK
result = MAPIReadMail(Session, 0, MessageID$, Flags, 0)
result = MAPIQueryOriginator(Originator$, Address$)
MsgBox Originator$ + " @ " + Address$
result = MAPILogoff(Session, 0, 0, 0)
End Sub