+ Reply to Thread
Results 1 to 8 of 8

Specify account when sending emails from excel

  1. #1
    Forum Contributor Bob@Sun's Avatar
    Join Date
    09-03-2009
    Location
    Montuak, Usa
    MS-Off Ver
    Excel 2007
    Posts
    438

    Specify account when sending emails from excel

    Hello all,

    I have a code that sends an excel sheet as an attachment to a specific email.

    The problem comes with the fact that I have two accounts in Outlook and need to send the email from the one that is not the default.

    I searched the web but did not find any solution. I read somewhere that there is no such code that can pick which email account should be used.


    Is this true and is there another way to do that task?

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Specify account when sending emails from excel

    You would need to automate Outlook and then set the SendUsingAccount property of the MailItem. I'm not an Outlook expert, but hopefully Googling that will get you somewhere, or you could try an Outlook forum, unless someone else jumps in here!
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor Bob@Sun's Avatar
    Join Date
    09-03-2009
    Location
    Montuak, Usa
    MS-Off Ver
    Excel 2007
    Posts
    438

    Re: Specify account when sending emails from excel

    That is my problem - SendUsingAccount property of the MailItem is available only with Outlook 2007 and I am using 2003

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Specify account when sending emails from excel

    Told you I wasn't an expert!
    You probably need the Logon method of the NameSpace - that allows you to specify an account and password.

  5. #5
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Specify account when sending emails from excel

    DonkeyOte always refers to this url http://www.rondebruin.nl/sendmail.htm
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Specify account when sending emails from excel


  7. #7
    Forum Contributor Bob@Sun's Avatar
    Join Date
    09-03-2009
    Location
    Montuak, Usa
    MS-Off Ver
    Excel 2007
    Posts
    438

    Re: Specify account when sending emails from excel

    I do not want to use CDO.

    I checked before the example from http://www.devnewsgroups.net/group/m...opic56403.aspx

    But coud not make it to work. Where should I use the Function Set Account - in excel or in Outlook?

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Specify account when sending emails from excel

    I think it would be something like this (requires a reference set to Outlook as written):
    Please Login or Register  to view this content.
    You would then need to create an email and do whatever you need to it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1