+ Reply to Thread
Results 1 to 9 of 9

Can't use Macro with passed variables

  1. #1
    Registered User
    Join Date
    03-07-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007/2010, Outlook 2007/2010
    Posts
    60

    Can't use Macro with passed variables

    I have a macro, copied from http://www.excelforum.com/outlook-pr...ject-line.html, which begins
    Please Login or Register  to view this content.
    Like this, though, it won't run and Outlook doesn't recognize it. If I take out the passing variable and make it
    Please Login or Register  to view this content.
    Outlook recognizes it, but it won't run since the MyMail variable is required. What do I do???

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Can't use Macro with passed variables

    That's not the procedure name in the linked thread. Post your code?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-07-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007/2010, Outlook 2007/2010
    Posts
    60

    Re: Can't use Macro with passed variables

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Can't use Macro with passed variables

    For that code to work you need to pass it a mail item.

    It's the attachments of the mail item you pass to it that the code is 'downloading'.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    03-07-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007/2010, Outlook 2007/2010
    Posts
    60

    Re: Can't use Macro with passed variables

    I would assume as much... but have never touched Outlook VBA until now (my work is primarily in Excel). How do I pass it a mail item?

    What I really need this to do eventually is go through every single mail item, check the size of the attachment, delete the mail items with attachments under a certain size, and save those which meet the size requirement. I figured this code was a good place to start.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Can't use Macro with passed variables

    What emails do you want to go through?

  7. #7
    Registered User
    Join Date
    03-07-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007/2010, Outlook 2007/2010
    Posts
    60

    Re: Can't use Macro with passed variables

    All of them, technically. I'm building this for our call center. The system we use records all of the calls made and emails a recording thereof to account admin. Everything in this box has attachments we need to download.

  8. #8
    Registered User
    Join Date
    03-07-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007/2010, Outlook 2007/2010
    Posts
    60

    Re: Can't use Macro with passed variables

    Any help? I've been pouring through threads here and on other forums and still have no results.

  9. #9
    Forum Contributor
    Join Date
    08-27-2006
    Posts
    136

    Re: Can't use Macro with passed variables

    Try this untested code.

    Assuming messages are in the Inbox.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to send email when date approaching/passed
    By TJBateson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-01-2012, 08:54 AM
  2. Formula/Macro to determine when 90 days have passed from pre-defined date
    By maacmaac in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-23-2011, 12:23 AM
  3. macro that finds variables in one column and enters values if variables found
    By xln00b in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-07-2010, 08:22 AM
  4. Macro required to send a specific email after a date has passed
    By philiasfogg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-12-2009, 05:32 AM
  5. Using formulas in VB with variables passed from Excel cells
    By nbwright in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-23-2007, 05:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1