A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Saving Attachments using VBA and parsing information from subject/body



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 12th 06, 03:52 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 4
Default Saving Attachments using VBA and parsing information from subject/body

I am working on some code to automatically save attachments based on
information in the email message. I have found plenty on information on
the basics of saving attachments, but I am looking to get a little more
advanced. First off, I want to stay away from rules all together and do
it entirely in VBA if possible. What I want to do is if certain
"triggers" are contained in the subject or body, then the attachments
will be saved to the local drive. I haven't decide yet what i will use
as the trigger, but lets just say if the subject or body contained the
phrase "%%SAVE", using the next 10 characters after that phrase, the
file(s) will be saved to a directory named whatever those 10 characters
are. Is it possible to use VBA to seach the subject or body for that
trigger? I want it so the trigger can be located anywhere and not in a
specfic place like the begining of the text. Thanks in advance.

Ads
  #2  
Old December 12th 06, 04:12 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Saving Attachments using VBA and parsing information from subject/body

You would have to save the attachment to the drive first, then use the methods of the application appropriate for each type of file to search its content. All that can be done in VBA, but the only Outlook portion of the project is saving the attachment to the file system.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in message ups.com...
I am working on some code to automatically save attachments based on
information in the email message. I have found plenty on information on
the basics of saving attachments, but I am looking to get a little more
advanced. First off, I want to stay away from rules all together and do
it entirely in VBA if possible. What I want to do is if certain
"triggers" are contained in the subject or body, then the attachments
will be saved to the local drive. I haven't decide yet what i will use
as the trigger, but lets just say if the subject or body contained the
phrase "%%SAVE", using the next 10 characters after that phrase, the
file(s) will be saved to a directory named whatever those 10 characters
are. Is it possible to use VBA to seach the subject or body for that
trigger? I want it so the trigger can be located anywhere and not in a
specfic place like the begining of the text. Thanks in advance.

  #3  
Old December 12th 06, 07:30 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 4
Default Saving Attachments using VBA and parsing information from subject/body

I'm sorry. I should have went into more detail. I dont need to search
in the attachment for the trigger just the body or subject of the email
message.

Sue Mosher [MVP-Outlook] wrote:
You would have to save the attachment to the drive first, then use the methods of the application appropriate for each type of file to search its content. All that can be done in VBA, but the only Outlook portion of the project is saving the attachment to the file system.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in message ups.com...
I am working on some code to automatically save attachments based on
information in the email message. I have found plenty on information on
the basics of saving attachments, but I am looking to get a little more
advanced. First off, I want to stay away from rules all together and do
it entirely in VBA if possible. What I want to do is if certain
"triggers" are contained in the subject or body, then the attachments
will be saved to the local drive. I haven't decide yet what i will use
as the trigger, but lets just say if the subject or body contained the
phrase "%%SAVE", using the next 10 characters after that phrase, the
file(s) will be saved to a directory named whatever those 10 characters
are. Is it possible to use VBA to seach the subject or body for that
trigger? I want it so the trigger can be located anywhere and not in a
specfic place like the begining of the text. Thanks in advance.


  #4  
Old December 12th 06, 07:56 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Saving Attachments using VBA and parsing information from subject/body

In that case, you can use the Instr() function to parse the Subject or Body property.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in message ps.com...
I'm sorry. I should have went into more detail. I dont need to search
in the attachment for the trigger just the body or subject of the email
message.

Sue Mosher [MVP-Outlook] wrote:
You would have to save the attachment to the drive first, then use the methods of the application appropriate for each type of file to search its content. All that can be done in VBA, but the only Outlook portion of the project is saving the attachment to the file system.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

wrote in message ups.com...
I am working on some code to automatically save attachments based on
information in the email message. I have found plenty on information on
the basics of saving attachments, but I am looking to get a little more
advanced. First off, I want to stay away from rules all together and do
it entirely in VBA if possible. What I want to do is if certain
"triggers" are contained in the subject or body, then the attachments
will be saved to the local drive. I haven't decide yet what i will use
as the trigger, but lets just say if the subject or body contained the
phrase "%%SAVE", using the next 10 characters after that phrase, the
file(s) will be saved to a directory named whatever those 10 characters
are. Is it possible to use VBA to seach the subject or body for that
trigger? I want it so the trigger can be located anywhere and not in a
specfic place like the begining of the text. Thanks in advance.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Blank Email Body and Subject paloli Outlook - General Queries 1 December 8th 06 02:12 PM
Saving Subject Text in Excel Doc bbkixx Outlook and VBA 1 June 15th 06 05:09 PM
How create rule that searches BOTH body and subject (OR not AND)? kdez Outlook - General Queries 3 May 17th 06 04:59 PM
Change advanced find to 'subject field and message body' ©® Outlook - General Queries 0 February 23rd 06 02:57 PM
How to filter email with blank subject, to, and message body ken4az Outlook - Installation 0 January 20th 06 05:27 PM


All times are GMT +1. The time now is 06:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.