Results 1 to 4 of 4

Thread: Can someone help me with this Outlook VBA..

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2014
    Posts
    25

    Can someone help me with this Outlook VBA..

    I had this code working when i was on Windows 8.1 and i upgraded to Windows 10 and now it isnt working.
    I made my own Archieve and had all mail move a copy to it when it comes in to my Inbox. This code used to mark the mail in my Inbox as unread after the copy.
    Please check it out.
    Name:  9-18-2015 10-26-38 AM.jpg
Views: 233
Size:  14.8 KBName:  9-18-2015 10-27-16 AM.png
Views: 223
Size:  22.6 KB

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,913

    Re: Can someone help me with this Outlook VBA..

    to mark the mail in my Inbox as unread after the copy.
    the code appears to be the opposite to this, marks all as read
    does the code run on application startup? does the code run when items are added to the collection?
    put a stop statement (or messagebox) to see it they are actually running
    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

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2014
    Posts
    25

    Re: Can someone help me with this Outlook VBA..

    Quote Originally Posted by westconn1 View Post
    the code appears to be the opposite to this, marks all as read
    does the code run on application startup? does the code run when items are added to the collection?
    put a stop statement (or messagebox) to see it they are actually running
    How it reads online where i got the code is
    Code:
    Private Sub Items_ItemAdd(ByVal Item As Object)
      Item.UnRead = False
      Item.Save
    End Sub
    I changed it back to this and nothing changes.
    Name:  9-22-2015 11-19-40 AM.png
Views: 98
Size:  1.6 KB
    As you can see from this picture. I want a copy of my mail to be moved to Archived Folder and for the Inbox to remain unread and Archived to be read.
    Attached Images Attached Images  

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,913

    Re: Can someone help me with this Outlook VBA..

    did you test if your code is running?
    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

Tags for this Thread

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