Results 1 to 8 of 8

Thread: Item_close

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2003
    Posts
    232

    Item_close

    I would like to write a macro which will occur every time the user closes a mail message. I created a script and put code into the Item_close function. The code is only executed when I close that email which the code is in. How do I get the code to be executed when I close any emails?

  2. #2
    New Member
    Join Date
    Jul 2003
    Location
    New York
    Posts
    8
    Hello Shevy

    OK you don't say what application you are working with, I am assuming its MS-Outlook, and you don't say what version you are using. Both of these are great to know when formulating an answer.

    OK you said <<< I created a script and put code into the Item_close function. >>>

    From what I know about VBA, this is the right place. Its an event that you want to trap and handle in a special way. But then you say:

    <<< The code is only executed when I close that email which the code is in. How do I get the code to be executed when I close any emails? >>>

    Yes that is true, you are handling the event of that message, I think you need it to be in a more global "template", so I think it might be better place in the ThisOutlookSession module, if you don't have even a broader module, like in MS-Excel you have the Persoanl.xls workbook, and in MS-Word your have the Normal.dot template.

    Good luck, and if you find it, let me know. Sure I will ask my friends and see who posts the message first : :

    Dr. Technology

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2003
    Posts
    232

    Item_close

    Thanks for your response.
    Yeah you guessed right. I am writing a VBA application in Outlook Version 9.0.
    I originally tried to put the code in the ThisOutlookSession module, but there was nowhere to make an item_close event handler. How would I do that???
    Basically, I am writing a VBA app for my company that when anyone in the company closes their incoming emails I want to l run a program.
    I would appreiciate any help with this...
    Thanks.

  4. #4
    New Member
    Join Date
    Jul 2003
    Location
    New York
    Posts
    8
    OK Shevy

    <<< Thanks for your response. >>>

    You are more than welcome, but don't thank me just yet. I am not an expert on Outlook VBA.

    I would like to ask you why is it that <<< when anyone in the company closes their incoming emails I want to l run a program. >>>? What will this program do? And why when the message is closed?

    I ask because if you are having difficulties with one event handler chances are you could use another, say when the main application window gets active again, which is right after the closing of a message window.

    Not all events behave the same, and some are more efficient than others.

    I'll check and see what I can find out for you, I'll post a reply so be on the lookout, not the out look : :.

    Dr. Technology

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 2003
    Posts
    232

    item_close

    To answer your questions:
    I am trying to write an app which will check the email that they close and see if there were attachments. If there are then I will ask the user if he wants to upload them to our website. The reason why I need it in the close event is frankly because my boss asked me to do it that way!! but truthfully what you suggested may be a good idea. do you know how to write that? what is that event called? The only problem with that is the main window can become active at any time not only after the user closed his email??
    I am anxiously awaiting your response on this.
    I have been trying to figure this out for quite some time now...
    Thanks.

  6. #6
    New Member
    Join Date
    Jul 2003
    Location
    New York
    Posts
    8
    Hello Shevy

    <<< ... why I need it in the close event is frankly because my boss asked me to do it that way!! ... >>>


    Pusha Pusha , unless your boss knows Outlook, let him or her shut up , just don't get fired!!!

    OK check the following MSKB artcile 290779 OL2002: Managing and Distributing Outlook VBA Projects.

    Hope this helps.

    Dr. Technology

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jul 2003
    Posts
    232

    item_close

    Thanks for your help.
    I already found a solution, I put all the code into the thisoutlooksession...
    Have a good day ;P

  8. #8
    New Member
    Join Date
    Dec 2007
    Posts
    1

    Re: Item_close

    can you tell me how you got it worked, i can't seem to get it working.

    I got basicly the same thing.

Posting Permissions

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



Click Here to Expand Forum to Full Width