+ Reply to Thread
Results 1 to 7 of 7

Using a different mailbox in "range to email"

  1. #1
    Forum Contributor
    Join Date
    10-28-2010
    Location
    quebec, canada
    MS-Off Ver
    o365
    Posts
    187

    Using a different mailbox in "range to email"

    Hi,

    This is the common script that people use to do range to email,

    It use the default email i have in my outlook. My outlook has 4 mailboxes and i wish not to use the default one.

    right not it sends from "[email protected]" (default email)

    But i also have in my outlook "[email protected]" and i wish to send from this one... what would i need to modify?

    Thank you!

    Please Login or Register  to view this content.
    Last edited by xatomicx; 06-06-2019 at 04:47 PM.

  2. #2
    Registered User
    Join Date
    02-05-2014
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    2

    Re: Using a different mailbox in "range to email"

    Sorry not something I have worked with in the past. Assuming you have looked at the url at the top of the code my first step would be to try and see if a .from field works with under the with OutMail.

  3. #3
    Forum Contributor
    Join Date
    10-28-2010
    Location
    quebec, canada
    MS-Off Ver
    o365
    Posts
    187

    Re: Using a different mailbox in "range to email"

    Me neither, i need to set account i want to use somewhere. I'm a VBA beginner, i can usually find my way trough but i'm puzzled on this one.

  4. #4
    Forum Contributor
    Join Date
    10-28-2010
    Location
    quebec, canada
    MS-Off Ver
    o365
    Posts
    187

    Re: Using a different mailbox in "range to email"

    So far,

    I've changed .send to .display so i can set it manually, but i'd love not having to do this step.

    cheers

  5. #5
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Using a different mailbox in "range to email"

    Untested since I only have the one outlook account, but you can use this snippet of code to get the account number that you want (and then remove the sub if you want).

    Please Login or Register  to view this content.
    Then change ".Send" in your original code to

    Please Login or Register  to view this content.
    Where "3" is the number that belongs to the email account you want to use (which you will know once you run the little sub above).

    Hope it helps
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  6. #6
    Forum Contributor
    Join Date
    10-28-2010
    Location
    quebec, canada
    MS-Off Ver
    o365
    Posts
    187

    Re: Using a different mailbox in "range to email"

    Thank you!

    So apparently account is 2.

    So i added

    Please Login or Register  to view this content.
    The script runs, no errors. But nothing is actually sent from any mailbox.

  7. #7
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Using a different mailbox in "range to email"

    Oops, that's my bad... I was clearly not thinking.

    I should have said that

    Please Login or Register  to view this content.
    goes BEFORE .Send, not replaces it as I had stated. Sorry about that, add .Send and hopefully that fixes it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Email rule in outlook with VBA script on shared mailbox
    By CR7 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-08-2015, 09:01 AM
  2. Open newest unread email in shared mailbox
    By Aaron092 in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2014, 04:04 PM
  3. Sending email from a shared mailbox
    By badlydrunkboy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-02-2014, 10:12 AM
  4. [SOLVED] Show newl message envelop notification for all mailbox/shared mailbox added in outlook
    By Goku in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 07-04-2014, 01:23 PM
  5. Moving email from shared mailbox containing certain words
    By andysmith84 in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 10-31-2013, 08:31 AM
  6. Macro to send outlook email from a different mailbox
    By naveenrv in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-25-2013, 05:11 PM
  7. Excel Email with Outlook - Mailbox full problem
    By ging18 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-01-2006, 12:42 PM

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