View Single Post
 
Old 09-17-2014, 11:46 PM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Quote:
Originally Posted by s_samira_21 View Post
But Where should I paste this code? ThisOutlookSession or a Module?
The code goes in an ordinary module.
You can test it by selecting a message and running the following:

Code:
Sub Test()
Dim olMsg As MailItem
Set olMsg = ActiveExplorer.Selection.Item(1)
ProcessAttachment olMsg
End Sub
Note that you will have to change the paths and the filename of your target workbook, and of course add the code to transfer whatever it is that you wish to transfer from one sheet to the other.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote