How can I open with VBA a attachment of excel file and verify inside the file before seva the message in a determined folder in outlook? -
i receive determined e-mails attached excel file , need know if email part of process before moving determined folder.
- the macro starts when email arrives.
- the macro verifies if email has excel attachment.
- if it's excel file, macro verifies if inside file first cell contains word "process".
- if true, macro moves email determined folder in outlook.
i can first , second step, don't know if it's possble open excel file attachment , verify first cell.
called rule.
sub test1(o outlook.mailitem) dim xl excel.application if instr(1, o.attachments(1), ".xls") > 0 set xl = new excel.application xl.visible = 1 ' save attachment here strattachmentname xl.workbooks.open strattachmentname if xl.activeworkbook.worksheets(1).range("a1").value = "processing" o.move application.getnamespace("mapi").getdefaultfolder(olfolderinbox) end if end if end sub
Comments
Post a Comment