Results 1 to 7 of 7

Thread: [RESOLVED] multiple times

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Resolved [RESOLVED] multiple times

    Hi!
    the below code is writing from outlook to excel
    every day i run this macro. if i run
    it will show existing sendername sent on received time adding several times in excel
    Last edited by kamakshi; Jul 30th, 2010 at 10:33 PM.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re: multiple times

    Hi!
    i have shared folders in outlook inbox which has saved inbox items as well as sent items
    i am trying to extract inbox sendername and sent on and sent items - received time.
    first time there is no issue. but second time run the macro from excel it adding old send itmes and inbox items into excel .
    i have coding below please help this one.
    thanks
    Last edited by kamakshi; Aug 1st, 2010 at 07:46 AM.

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: multiple times

    wouldn't you need to check if each mail item has already been added into the excel sheet before adding it?
    you could check by received time or some other property
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re: multiple times

    how do i perform please let me know

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re: multiple times

    each mail items is specific subject only i added into excel.
    sendername sendtime received time
    only three columns in excel

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: multiple times

    yes but each time you run the code it adds all the mailitems even if they were added before
    assuming the sender and subject can be used many times the only value to check for is time /date

    use excel's find method to check if the time of the current mailitem is already in the worksheet
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Re: multiple times

    Thank you Westconn,. i got it.

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