Results 1 to 7 of 7
  1. #1
    jimdoria
    Guest

    Autorun macro still OK? (2003 SP-1)

    Hello all -

    I'm trying to run a couple of VBA macros from desktop shortcuts using the /autorun command line switch, but it's not working. Instead of running the macros, Outlook just comes to the front and switches to the Inbox.

    I've checked nmy spelling and capitalization. The macros appear in the list when I choose Tools -> Macro -> Macros... from the Outlook menu. They work fine when I run them from the VBA editor. They are stored in Module1 of VbaProject.OTM.

    Any idea what might be wrong? Is this functionality still supported, or has some security update disabled it? Also, is it possible to combine switches /autorun and /recycle?

    Thanks for any help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Autorun macro still OK? (2003 SP-1)

    It seems that /autorun only works if macro security is set to low, which is generally not recommended. See the discussion in this newsgroup thread for some alternatives.

    I don't know if /autorun and /recycle can be combined, but I doubt it. You can try, though.

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Autorun macro still OK? (2003 SP-1)

    What do the macros do, what folders/messages, etc, do they operate on? The timing of using autorun, and even Application_Startup (mentioned by Ken Slovak in the newsgroup thread Hans referenced), may not be right if you have some rules or other event actions which operate on startup. I have this issue with Rules that run on startup.
    -John ... I float in liquid gardens
    UTC -7DS

  4. #4
    jimdoria
    Guest

    Re: Autorun macro still OK? (2003 SP-1)

    Hmm, Ken Slovak says:
    > There is no autorun switch, and no autorun macros like in Word.

    While Microsoft says (http://office.microsoft.com/en-us/as...031101033.aspx):
    > /autorun macroname Opens Outlook and immediately runs the macro specified in macroname.

    Who to believe? <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

    Anyway, the purpose of these macros is to semi-automate my current personal timecard system. I have a shortcut to a new Journal item on my desktop, which I open up, then enter "Started Work", "Finished Work" or "Lunch" (with timer). Except the journal entry always comes up as a phone call, so I have to manually switch it to "note", then enter the recurring info, etc.

    I finally got tired of typing in the same text every day, with my frequent typos and ocassionally forgetting to change the item type. So I figured I'd just automate it all and have 3 separate shortcuts. The macros I wrote work great and do exactly what I want. But now I can't get them to run the way I'd expected (and had been told they WOULD by the above referenced MS site.) So instead of increasing my level of convenience, it seems like this project has just been a waste of my time.

    I thought this would be a piece of cake, but as usual, there's no cake for Jim when VBA is on the table. <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>

    Anyway, would signing the macros work? I seem to remember seeing something about self-certification. Don't know if I can just set security to low - it might be against company policy.

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Autorun macro still OK? (2003 SP-1)

    Ken is referring to the old Word and Excel Autorun VBA commands - Outlook's Command Line Autorun switch is different, and still available.

    I think you'd be best off attaching your macros to the Application Startup in the ThisOutlookSession module.

    Signing the macros will only stop the "This Outlook Session has macros - do you want to run them?" (or whatever the words are) dialog at startup, which is nice for avoiding that nuisance.
    -John ... I float in liquid gardens
    UTC -7DS

  6. #6
    jimdoria
    Guest

    Re: Autorun macro still OK? (2003 SP-1)

    Thanks, John - but I don't think that'll get me what I'm after.

    I keep Outlook running almost all the time. That was why I wanted to combine /autorun with /recycle. I don't want these macros to run on startup - I want them to run on demand i.e. when I click the desktop shortcuts.

    I'll probably just wind up adding a new toolbar in Outlook and putting buttons for the macros there. Not exactly the workflow I wanted, but close enough I guess. It's just frustrating to see a feature documented that seems to do exactly what you want, and then find it simply doesn't work.

    Thanks for your help anyway!

  7. #7
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autorun macro still OK? (2003 SP-1)

    >I'll probably just wind up adding a new toolbar in Outlook and putting buttons for the macros there.

    You might not need an entire new toolbar. Set up a new item on an existing toolbar. Make the view Text Only. Edit the text down to one letter with an & in front of it (be careful with your choice of letter - see next step). Provided you've not chosen an existing "Hotkey" letter (such as F), your macro will run on Alt + [whatever letter you've chosen].

    Post back if it's not quite clear to you.

    HTH
    Gre

Posting Permissions

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