Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
procedure TForm1.btn_SaveattachmentsClick(Sender: TObject);
TheUID := StringGrid1.Cells[1, StringGrid1.Selection.Top];
TheMsg := TIdMessage.Create(nil);
for nMsgPartsCount := 0 to TheMsg.MessageParts.Count-1 do
if TheMsg.MessageParts[nMsgPartsCount] is TIdAttachment then
if TheMsg.MessageParts[nMsgPartsCount] is TIdAttachmentFile then
fName := TIdAttachmentFile(TheMsg.MessageParts.Items[nMsgPartsCount]).Filename;
if (fName <> '') then
fName := ExtractFilePath(Application.exename)+'download\' + fName;
ShowMessage('Attachment saved '+fName);
ShowMessage('Attachment ignored - Not recognised as a file');
Open in new window
From novice to tech pro — start learning today.
Members can enroll in this course at no extra cost.