Results 1 to 9 of 9
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,191

    Scroll to next email received

    Hi Guys, is there a method of having a button to scroll the the next email (received after the current one) via a cmd Button ?



    This is a loose attempt but my lack of understanding won't make it work at all, thank you

    Code:
    Dim oItem As MailItemDim outApp As Outlook.Application
    Dim objItem As Object
    Dim olExplorer As Outlook.Explorer
    Dim sText As String, vText As Variant, i As Integer
    
    
    
    
    Set oExplorer = outApp.ActiveExplorer
    Set oItem = objItem
    
    
    If oExplorer Is Nothing Then
        MsgBox "No Outlook explorer open!", vbCritical, "No Outlook Explorer"
    End If
    
    
    If oExplorer <> 0 Then
        For Each objItem In ActiveExplorer.Selection
        With oItem
        sText = oItem.Body
        vText = Split(sText, Chr(13))
        For i = UBound(vText) To 0 Step -1
        vItem = Split(vText(i), Chr(9))
        Me.txtMailMessage = vText
        End With
    End If
        Next i
    
    
    Set outApp = Nothing
    Set objItem = Nothing
    Set oExplorer = Nothing

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,925
    Identify how many emails are selected, store that in a public variable/TempVar then use another variable to increment and use that to select the next email?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,191
    Hi welshgasman, ok, is it possible if you have some vba to post to get me started on ?

    Kindest

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,925
    I have none,it was a just a theory from writing the attachments code?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Hi Dave,
    What do you mean by "scroll" to the next email? Do you want to actually control the Outlook window to load the next email or you want to present that in Access on your form. Please have a look at my free utility http://forestbyte.com/ms-access-util...ook-companion/ that has a form to look at any specified folder in Outlook.
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    I haven't done anything with outlook for years. Hope this is useful.
    But I recall blueclaw having several examples that were often referenced.

    If you search this forum using Outlook and attachment or similar you'll find several hits.

    I was thinking of a For Loop generally and found this thread.

  7. #7
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,191
    Thank you guy's will check it out, Yes Vlad, thank you, if when we open inbox, there may be 20 new mails to respond to in which our db will check the email address to confirm a user has replied

    so rather than keep minimizing windows to select the next mail from inbox, a button to select the next email

    also we would click on the 1st mail arrived so that's what I meant by working to next mail when received later than the current one

    Will give it a go, thank you all again

  8. #8
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    I think the frmReadEmail in my utility would work for you with some adjustments, have a look and post back please.
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  9. #9
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,191
    Hi Vlad, thank you, yes will take a look soon as i get chance, been dragged away from it temporarily but will certainly and much appreciated as always

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 09-02-2016, 03:47 PM
  2. Replies: 1
    Last Post: 02-11-2016, 12:35 PM
  3. Replies: 2
    Last Post: 09-10-2015, 03:21 PM
  4. Invoice and payments received
    By esther6086@lowcountry.com in forum Queries
    Replies: 1
    Last Post: 08-13-2013, 06:28 PM
  5. 3464 error received
    By TEN in forum Programming
    Replies: 10
    Last Post: 07-08-2009, 07:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums