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.

  1. the macro starts when email arrives.
  2. the macro verifies if email has excel attachment.
  3. if it's excel file, macro verifies if inside file first cell contains word "process".
  4. 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

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -