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

    Find Details Within Email Search

    Hi Guy's, the below code will narrow down emails exchanged for the specific email address, is there a method i can find values within this range of emails (may not be one that is selected currently but within the email address) ?



    For Example, to Find:

    We Can Offer
    Or
    We Would Have To Charge
    Or
    Free Removal

    Those are the 3 strings I would like to find within the searched email range ??

    Is it possible to perhaps use instr for range of emails ?

    Code:
    Dim app As ObjectDim SearchString As String
    
    
    Set app = GetObject(, "Outlook.Application")
    On Error GoTo 0
    If app Is Nothing Then
    Set app = CreateObject("Outlook.Application")
    app.Explorers.Add app.GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
    app.Explorers(1).Activate
    End If
    SearchString = Me.txtEmailAddress
    app.ActiveExplorer.Search SearchString, olSearchScopeAllFolders
    Set app = Nothing
    DoCmd.RunCommand acCmdAppMinimize

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I tested this code. All it does is yellow highlight words in all emails (any part of email) that match words in search string.

    What do you really want to accomplish?

    Access can set link to Outlook folder.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195
    Hi June7, that's great so I may put a text box on the form called txtValueFound

    If string matches: We Can Offer £000.00
    txtValueFound = We Can Offer You £000.00" (however we retrieve the value whether it be 3 digits, 4 or 5 digits etc £1.00 or £10.00 or £100.00 (whatever value is found in search string)

    Or


    If String matches: We Would Have To Charge
    txtValueFound = We Would Have To Charge £000.00" (however we retrieve the value whether it be 3 digits, 4 or 5 digits etc £1.00 or £10.00 or £100.00 (whatever value is found in search string)

    Or

    If String matches: We Can Offer Free Removal
    txtValueFound = We Can Offer Free Removal

    Fantastic if this can be achieved ?

    Kindest

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Code does not match entire string as a unit, it matches each word. So if you search for We Can Offer Free Removal and email had only the word Offer it would be highlighted. Also, I don't know if can get feedback on which emails are matched.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 3
    Last Post: 09-29-2020, 06:28 AM
  2. Replies: 4
    Last Post: 08-30-2016, 03:00 PM
  3. sending specific details to pdf and email
    By blappy347 in forum Import/Export Data
    Replies: 1
    Last Post: 03-29-2013, 12:46 PM
  4. How to find Country by using the email address?
    By jamesfranklin in forum Programming
    Replies: 2
    Last Post: 03-07-2013, 07:07 AM
  5. Replies: 0
    Last Post: 10-16-2008, 02:39 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