Consulting

Results 1 to 3 of 3

Thread: How to delete an AddressEntry

  1. #1
    VBAX Newbie
    Joined
    May 2008
    Posts
    3
    Location

    How to delete an AddressEntry

    I have a number (counter) of email addresses in an AddressList which I have copied into an array (arAgencyemail). I also have a number of emails (bodycount) that contain email addresses in the body of the email. I have copied the email body texts into another array (arBodies). I want to search through the arAgencyemail array and where the email address matches one in the body text array, delete the corresponding address in the AddressList.
    How do I find the addressEntry so that I can delete it. I know its number in the Index of the AddressList from the outer For.....Next loop but I can't work out how to delete it.

    [vba]For x = 1 To counter
    For y = 1 To bodycount
    If InStr(arAgencyemail(x), arBodies(y)) Then

    ' olAgency.Delete????
    End If
    Next
    Next[/vba]
    [uvba].[/uvba]
    ~Oorang

  2. #2
    Knowledge Base Approver VBAX Master Oorang's Avatar
    Joined
    Jan 2007
    Posts
    1,135
    Location
    Hi Sluice,
    Welcome to the board Could you please post the complete code? Thanks
    Cordially,
    Aaron



    Keep Our Board Clean!
    • Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
    • Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.

  3. #3
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    Quote Originally Posted by sluice
    I have a number (counter) of email addresses in an AddressList which I have copied into an array (arAgencyemail). I also have a number of emails (bodycount) that contain email addresses in the body of the email. I have copied the email body texts into another array (arBodies). I want to search through the arAgencyemail array and where the email address matches one in the body text array, delete the corresponding address in the AddressList.
    How do I find the addressEntry so that I can delete it. I know its number in the Index of the AddressList from the outer For.....Next loop but I can't work out how to delete it.

    [vba]For x = 1 To counter
    For y = 1 To bodycount
    If InStr(arAgencyemail(x), arBodies(y)) Then

    ' olAgency.Delete????
    End If
    Next
    Next[/vba]
    [uvba].[/uvba]
    ~Oorang
    Why putting the addressentry's in an array first. Why not using the folder off the adresses. So for every address entry in the folder, check the mailaddress in one of the mails. If found, delete the address ...

    Charlize

Posting Permissions

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