स्वीकार्य उत्तर पर थोड़ा सा विस्तार, मुझे मुकदमा के set_account फ़ंक्शन के डेल्फी कार्यान्वयन की आवश्यकता थी। इसके लिए कहीं भी इंटरनेट पर कुछ भी नहीं मिला, इसलिए यहां मुकदमा के कोड की डेल्फी व्याख्या है।
Function SetAccount(TargetAccount:string; var MailItem:OLEVariant):boolean;
var OLI,CBs,CBP,MC:olevariant;
strAccountBtnName:String;
i,t:Integer;
FoundAccount:Boolean;
Const ID_ACCOUNTS = 31224;
begin
FoundAccount:=false;
OLI:=MailItem.GetInspector;
CBs:=OLI.CommandBars;
CBP:=CBs.FindControl(, ID_ACCOUNTS);
t:=1;
while (not FoundAccount) and (t<=CBP.Controls.Count) do begin
MC:=CBP.Controls[t];
i:=Pos(' ',MC.Caption);
if i > 0 Then strAccountBtnName:=Copy(MC.Caption,i+1,Length(MC.Caption)-i)
else strAccountBtnName:=MC.Caption;
if strAccountBtnName = TargetAccount then begin
MC.Execute;
FoundAccount:=true;
end;
inc(t);
end;
Result:=FoundAccount;
end;
मुकदमा दायर करने के लिए क्रेडिट, धन्यवाद, आप के बिना यह नहीं किया जा सका :)