[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

Outlook 2003 VBA needed to parse a subject line and run a dos batch file passing parameters

Asked by smyers051972 in VB Script, Outlook Groupware Software

Tags: Microsoft, Outlook, 2003, Outlook VBA Subject line parsing

I have a VBA script that is set up with a rule in outlook 2003 that takes an attachment and copies it to the hard drive, then a batch file is run against that script file. This way is just not as efficient and would like some help getting a new VBA that would provide the following functionality:

End User sends an email to a specified email account (only accessable internally) with the following text in the email subject: Report ReportName player# ship

Through a rule set up in outlook 2003 would match the word "Report" in the subject line, a VBA script is called and does the following:

1. VBA code should first generate a email receipt back to the address that sent the request stating the following in the email:

From: Noreply@ (fake address)
Subject: ReportName Player# Ship Reciept  <- (Parsed and below from Subject)

Body:
The Report you requested for player# on ship was received and will be processed shortly, once completed it will be emailed back to you as a PDF attachment. Thank you.

After the reciept is emailed, the script should continue and call a dos batch file with the following parameters: C:\reports\myreport reportname player# ship requesting_email_address

When the VBA is calling the batch file, the data it sends would all be parsed from the subject and the email address of the original requestor should be passed as shown above. One reason for using the subject line also helps when users would send HTML and Text formatted emails, this should eliminate that issue however in the alternative perhaps the email could be converted to text format through the script first if it would possibly still become an issue some how.

Thanks again for your help.  I have attached the VBA script I have now however all it does is copy the attachment to the hard drive and then a third step in my rule calls a batch file through outlook rules and the dos batch file parses the text file.  I really would like to eliminate all that and just go from the subject line as shown above.

Thanks again!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
Sub AARSaveAttachmentsToDiskRule(olkMessage As Outlook.MailItem)
    Dim olkAttachment As Outlook.Attachment, _
        objFSO As Object, _
        strRootFolderPath As String, _
        strFilename As String
    'Change the path on the following line to the folder you want the attachments save in
    strRootFolderPath = "C:\util\reports\"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    For Each olkAttachment In olkMessage.Attachments
        strFilename = olkAttachment.FileName
        intCount = 0
        Do While True
            If objFSO.FileExists(strRootFolderPath & strFilename) Then
                intCount = intCount + 1
                strFilename = "Copy (" & intCount & ") of " & olkAttachment.FileName
            Else
                Exit Do
            End If
        Loop
        olkAttachment.SaveAsFile strRootFolderPath & strFilename
    Next
    Set objFSO = Nothing
    Set olkAttachment = Nothing
    Set olkMessage = Nothing
End Sub
[+][-]12/09/08 10:24 AM, ID: 23131746Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: VB Script, Outlook Groupware Software
Tags: Microsoft, Outlook, 2003, Outlook VBA Subject line parsing
Sign Up Now!
Solution Provided By: chris_bottomley
Participating Experts: 1
Solution Grade: A
 
[+][-]12/06/08 08:08 PM, ID: 23114711Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]12/08/08 08:23 AM, ID: 23121584Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/08/08 12:16 PM, ID: 23123742Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/08/08 01:03 PM, ID: 23124185Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/08/08 01:33 PM, ID: 23124505Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/09/08 01:18 AM, ID: 23127791Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/09/08 01:23 AM, ID: 23127815Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/09/08 06:28 AM, ID: 23129332Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/09/08 07:34 AM, ID: 23129972Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/09/08 08:15 AM, ID: 23130381Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/09/08 08:23 AM, ID: 23130470Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/09/08 08:24 AM, ID: 23130489Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/09/08 08:57 AM, ID: 23130859Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/09/08 09:13 AM, ID: 23131034Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/09/08 09:31 AM, ID: 23131231Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/09/08 11:09 AM, ID: 23132285Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/09/08 11:18 AM, ID: 23132369Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12/09/08 11:38 AM, ID: 23132560Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/09/08 11:44 AM, ID: 23132629Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/09/08 12:45 PM, ID: 23133463Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_2_20070628