Reputation:
I receive determined e-mails with an attached excel file and I need to know if this email is part of a process before moving it to a determined folder.
I can do the first and second step, but I don't know if it's possble to open a excel file attachment and verify the first cell.
Upvotes: 0
Views: 2993
Reputation: 8531
Called from a rule.
Sub TEST1(o As Outlook.MailItem)
Dim xl As Excel.Application
If InStr(1, o.Attachments(1), ".xls") > 0 Then
Set xl = New Excel.Application
xl.Visible = 1
' Save the attachment here as strAttachmentName
xl.Workbooks.Open strAttachmentName
If xl.ActiveWorkbook.Worksheets(1).Range("a1").Value = "Processing" Then
o.Move Application.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
End If
End If
End Sub
Upvotes: 0