Microsoft Office Tutorials and References
In Depth Information
Transferring Data from E-mail Attachments to Excel
13. The macro tool contains an 'AutoNew' procedure so that the UserForm
appears whenever the user creates a new document from the template.
Comment out the procedure if this is not wanted.
14. To make it easy to edit the input at a later time, assign the procedure
'GetUserInput' to a toolbar button. The macro automatically picks up
the bookmarked content when it displays the UserForm. See Running a
Macro from a Toolbar Button on page 418 for help in assigning a macro
to a toolbar button.
Transferring Data from E-mail Attachments to Excel
By Suat Ozgur
This macro shows how to handle incoming e-mail messages in Outlook. It also
illustrates how to read and write data between Excel workbooks.
Example file:
O006.xls and O006-
Scenario: A workbook template is sent to all department
heads. They are to fill in required information and then
return the workbook. Now, you need an efficient way to
retrieve the data and compile it.
This application tracks the e-mail messages. When the
returned file meets the criteria in a received e-mail message
(it is returned as the template file name in this sample code),
then the application transfers the data in the returned file to
a main data storage file.
The code uses the Application_Startup event procedure to start tracking and
creates an Items object to identify folder items for new e-mail messages. The
assumptions in the sample code are listed below the code sections. These can be
customized to implement the solution for special needs in a Class module
declaration section.
Place the following code in the ThisOutlookSection class module (accessed by
double-clicking the ThisOutlookSection title in the Project Explorer window
(top left):
View the Appendix to learn how to store this procedure
in a ThisOutlookSession Class module (in Outlook).
Search JabSto ::

Custom Search