If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Check Profile info
I need to know how to check, when the OL Object is instantiated, the
default profile's email address. We want to check to see if the email of the user logged into our application is the same as the one in the default profile in OL. (I am using Delphi but can translate the VBA, if needed) |
Ads |
#2
|
|||
|
|||
Check Profile info
On Jun 29, 8:36*am, MB34 wrote:
I need to know how to check, when the OL Object is instantiated, the default profile's email address. We want to check to see if the email of the user logged into our application is the same as the one in the default profile in OL. (I am using Delphi but can translate the VBA, if needed) OK, found the answer based on a 7yr old post of mine on DelphiPages: uses ..., Outlook2000, MAPIDefs, MAPIUtil; var pmOutlook: _Application; NameSpace: _NameSpace; DefaultUser: Recipient; _AddressEntry: AddressEntry; pProp: PSPropValue; MP: IMAPIProp; strAddress: String; begin try pmOutlook := GetActiveOleObject('outlook.application') as _Application; except try pmOutlook := CreateOleObject('outlook.application') as _Application; except on e:EOleSysError do ShowMessage('Cannot Load Outlook:' + E.Message); end; end; try Namespace := pmOutlook.GetNamespace('MAPI'); MAPIInitialize(nil); try DefaultUser := NameSpace.CurrentUser; if DefaultUser.Address '' then begin _AddressEntry := DefaultUser.AddressEntry; MP:= IUnknown(_AddressEntry.MAPIOBJECT) as IMailUser; if S_OK = HrGetOneProp(MP, $39FE001E, pProp) then begin strAddress:=pProp.Value.lpszA; MAPIFreeBuffer(pProp); end; ListBox1.Items.Add(_AddressEntry.Name + ' : ' + strAddress); Application.ProcessMessages; end; {if} finally MAPIUninitialize; end; finally pmOutlook.Application.Quit; pmOutlook := Unassigned; Namespace := Unassigned; DefaultUser := Unassigned; _AddressEntry := Unassigned; end; end; |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook Signature error during spell check Text marked with "Do not check spelling or grammar" was skipped. | John Peters | Outlook - General Queries | 0 | September 25th 07 07:48 PM |
How to check if a user has outlook profile created from c# .Net | Raj | Outlook - Using Forms | 3 | September 18th 07 02:54 PM |
What info is stored in the Outlook Profile? | Al Dykes | Outlook - General Queries | 1 | January 4th 07 04:30 PM |
Outlook express can't spell check. It says to check later. | Harold | Outlook - General Queries | 2 | September 8th 06 10:56 PM |
Need to transfer info from one user profile to another | tom | Outlook - General Queries | 3 | May 30th 06 09:12 PM |