Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,562


    Quote Originally Posted by DMT Dave View Post
    Not sure how to do this within the html

    can easily set it outside of the html but i am assuming this needs to be set within html ?
    No , you set it within Windows ?
    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

  2. #17
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,365
    Yes done that, it does now open in outlook correctly

    Just now need to set which account on this specific event

  3. #18
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,562
    I used to use SendUsingAccount ?

    Code:
     .SendUsingAccount = objOutlook.Session.Accounts.Item(intAccount)
    where intAccount is the order of the accounts in my Outlook.

    Alternatively use this to find out which account index is your required account. I have this in Outlook, but should work in Access?

    Code:
    Public Function ListEMailAccounts(AcctToUSe As String) As Integer
        Dim outApp As Object
        Dim i As Integer
        Dim AccNo As Integer
        Dim emailToSendTo As String
        
        Set outApp = CreateObject("Outlook.Application")
        'emailToSendTo = "epsteel@gmail.com"                    'put required email address
        AccNo = 1
        'if smtp address=email we want to send to, acc no we are looking for is identified
        For i = 1 To outApp.Session.Accounts.Count
            'Uncomment the Debug.Print command to see all email addresses that belong to you
    'Debug.Print "Acc name: " & OutApp.Session.Accounts.Item(i) & " Acc number: " & i & " , email: " & OutApp.Session.Accounts.Item(i).SmtpAddress
            'If OutApp.Session.Accounts.Item(i).SmtpAddress = emailToSendTo Then
            If outApp.Session.Accounts.item(i).DisplayName = AcctToUSe Then
    
    
                AccNo = i
                Exit For
            End If
        Next i
        ListEMailAccounts = AccNo
        Set outApp = Nothing
    End Function
    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

  4. #19
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,365
    Thank you WGM, i know what you mean by using intAccout as Send UsingAccout(1) is primary (2) is next account etc...

    Will read through your Function tonight to see what i can pick up from it

    Kindest

  5. #20
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,562
    Quote Originally Posted by DMT Dave View Post
    Thank you WGM, i know what you mean by using intAccout as Send UsingAccout(1) is primary (2) is next account etc...

    Will read through your Function tonight to see what i can pick up from it

    Kindest
    Would be safer to use the Account Name, as if you move the accounts up or down, the index will change?, plus if another user needs to use it, their account order might not match yours?

    So use that function to return the index number of the account required?
    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

  6. #21
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    I imagine you have a reason for this approach but I admit I'm a bit baffled why anyone would open an email via vba and insert a mailto link in an email they don't intend to send (as per post 6) just to get a list of some sort.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #22
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,365
    @Micron, yes i though using a list is much less messy than bringing an array of results to an email body then adding an email link within the body to send email form, that was the focus

    populating a list with the same results then add new email for the email address on the selected row number, that would be an easy answer i guess ?

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 10-07-2019, 08:04 PM
  2. how to validate html for url link
    By arobot in forum Access
    Replies: 1
    Last Post: 06-01-2015, 03:01 PM
  3. Emailing example
    By pkstormy in forum Code Repository
    Replies: 4
    Last Post: 01-31-2014, 04:22 PM
  4. Replies: 7
    Last Post: 08-28-2013, 02:30 AM
  5. Replies: 0
    Last Post: 01-18-2007, 07:07 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