Get folder path where an account stores messages

Status
Not open for further replies.
K

Kamran A

This is my first time developing an add-in for Outlook 2007. I have

successfully been able to retrieve accounts and successfully been able to

retrieve stores.

However, I see no way to correlate the two. My goal is to find what path (or

store) the account is using to store messages in. I see no property on a

store to get an account and see no property to get a store on account.

Is there any way to do this? In the GUI it's easy enough! Is it a rule or

something? How would I find it?

Thanks for any help!
 
K

Ken Slovak - [MVP - Outlook]

An email account doesn't have a mail store associated with it, an Outlook

profile has both accounts and one or more mail stores associated with it.

By default anything you send from any account in a profile ends up in your

default mail store for that profile.

There is a hot fix available that lets the Sent Items folder of a

non-default Exchange mailbox get items sent using the email address for that

non-default Exchange mailbox, instead of the items going to Sent Items in

the default store. That's controlled by a registry setting, but it doesn't

apply to PST files, only to Exchange mailboxes.

You can get the sending address of the item from the

MailItem.SendUsingAccount property. That might help you determine where to

route things if that's your goal.

"Kamran A" <KamranA> wrote in message

news:9F1D0FC8-1064-4108-8E65-E7ADAF65C36B@microsoft.com...
> This is my first time developing an add-in for Outlook 2007. I have
> successfully been able to retrieve accounts and successfully been able to
> retrieve stores.

> However, I see no way to correlate the two. My goal is to find what path
> (or
> store) the account is using to store messages in. I see no property on a
> store to get an account and see no property to get a store on account.

> Is there any way to do this? In the GUI it's easy enough! Is it a rule or
> something? How would I find it?

> Thanks for any help!
 
K

Kamran A

Hi Ken, thanks for the information.

My ultimate goal for this add-in is to automatically determine what account

to send from for composing new mail based on the current folder selected.

This is a user experience feature missing from Outlook (that Thunderbird does

automatically).

The only obstacle is getting the mail delivery location associated with an

email account (shown in the GUI). The add-in works fine if I hard code the

path-to-account information, but of course that is not ideal.

The other viable option is to match root folder names with account display

names and that is something I'd like to avoid.

Is there any way to do what I'm talking about?
wrote:


> An email account doesn't have a mail store associated with it, an Outlook
> profile has both accounts and one or more mail stores associated with it.

> By default anything you send from any account in a profile ends up in your
> default mail store for that profile.

> There is a hot fix available that lets the Sent Items folder of a
> non-default Exchange mailbox get items sent using the email address for that
> non-default Exchange mailbox, instead of the items going to Sent Items in
> the default store. That's controlled by a registry setting, but it doesn't
> apply to PST files, only to Exchange mailboxes.

> You can get the sending address of the item from the
> MailItem.SendUsingAccount property. That might help you determine where to
> route things if that's your goal.

> >

>

> "Kamran A" <KamranA> wrote in message
> news:9F1D0FC8-1064-4108-8E65-E7ADAF65C36B@microsoft.com...
> > This is my first time developing an add-in for Outlook 2007. I have
> > successfully been able to retrieve accounts and successfully been able to
> > retrieve stores.
> > However, I see no way to correlate the two. My goal is to find what path
> > (or
> > store) the account is using to store messages in. I see no property on a
> > store to get an account and see no property to get a store on account.
> > Is there any way to do this? In the GUI it's easy enough! Is it a rule or
> > something? How would I find it?
> > Thanks for any help!


>
 
K

Ken Slovak - [MVP - Outlook]

Like I said, an email account is not tied to a store (other than with

Exchange mailboxes). If you have an Exchange mailbox or even a public folder

you can get the email address for that store and if you have permissions you

can send using that account.

If you have POP3 accounts how could those be tied to a store? A PST file can

be opened exclusively by anyone with access to it with no limitations. So I

could open it in one profile that has 3 mail accounts and then in another

profile that has a different 3 accounts. How do you distinguish?

I think your design is fundamentally flawed due to this misunderstanding

about the relationships between mail stores, profiles and email accounts.

All you can do is get the accounts for that profile (Outlook session) and

then guess.

"Kamran A" <KamranA> wrote in message

news:DF530F0C-14D7-4669-89D8-CD19BE4A5063@microsoft.com...
> Hi Ken, thanks for the information.

> My ultimate goal for this add-in is to automatically determine what
> account
> to send from for composing new mail based on the current folder selected.
> This is a user experience feature missing from Outlook (that Thunderbird
> does
> automatically).

> The only obstacle is getting the mail delivery location associated with an
> email account (shown in the GUI). The add-in works fine if I hard code the
> path-to-account information, but of course that is not ideal.

> The other viable option is to match root folder names with account display
> names and that is something I'd like to avoid.

> Is there any way to do what I'm talking about?
 
K

Kamran A

I think it makes more sense if I can show you what I want:

http://farm3.static.flickr.com/2555/3865134862_097374ac08_o.gif

Outlook must store this information somewhere, all I really care about is

how to get it. If it's possible, my job is done, otherwise I will need to

make a hack.

Thanks for your help!
wrote:


> Like I said, an email account is not tied to a store (other than with
> Exchange mailboxes). If you have an Exchange mailbox or even a public folder
> you can get the email address for that store and if you have permissions you
> can send using that account.

> If you have POP3 accounts how could those be tied to a store? A PST file can
> be opened exclusively by anyone with access to it with no limitations. So I
> could open it in one profile that has 3 mail accounts and then in another
> profile that has a different 3 accounts. How do you distinguish?

> I think your design is fundamentally flawed due to this misunderstanding
> about the relationships between mail stores, profiles and email accounts.
> All you can do is get the accounts for that profile (Outlook session) and
> then guess.

> >

>

> "Kamran A" <KamranA> wrote in message
> news:DF530F0C-14D7-4669-89D8-CD19BE4A5063@microsoft.com...
> > Hi Ken, thanks for the information.
> > My ultimate goal for this add-in is to automatically determine what
> > account
> > to send from for composing new mail based on the current folder selected.
> > This is a user experience feature missing from Outlook (that Thunderbird
> > does
> > automatically).
> > The only obstacle is getting the mail delivery location associated with an
> > email account (shown in the GUI). The add-in works fine if I hard code the
> > path-to-account information, but of course that is not ideal.
> > The other viable option is to match root folder names with account display
> > names and that is something I'd like to avoid.
> > Is there any way to do what I'm talking about?


>
 
K

Ken Slovak - [MVP - Outlook]

But if you have 3 different mailboxes or PST files loaded that will only

tell you what the Accounts collection tells you in Outlook 2007.

It does not tell you which account or accounts are associated with a

particular mail store, if there is any such association at all (there only

is with Exchange mailboxes or public folders). PST files have no email

account association at all.

Also, I can send as Sales or Support or Webmaster or various other email

accounts (mailboxes) in my domain, in addition to my own email address.

Those mailboxes may or may not be loaded in my Outlook session at all.

"Kamran A" <KamranA> wrote in message

news:FF6CDAAB-105A-441D-8111-79B12E17D4D6@microsoft.com...
> I think it makes more sense if I can show you what I want:

> http://farm3.static.flickr.com/2555/3865134862_097374ac08_o.gif

> Outlook must store this information somewhere, all I really care about is
> how to get it. If it's possible, my job is done, otherwise I will need to
> make a hack.

> Thanks for your help!
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
B BCC issues after changing root folder path for gmail Using Outlook 1
G [Help] Converting array to destination folder path Outlook VBA and Custom Forms 1
H "Advanced find: column for full folder path? Using Outlook 1
A Outlook VBA - moving mail item to public folder using variable within path Using Outlook 6
S Script w/relative path that sends absolute path to a folder to theclipboard? Outlook VBA and Custom Forms 3
G Automatically delete messages in the synchronization folder Outlook VBA and Custom Forms 1
wayneame Changing the Form Used by Existing Task Items in a Folder Outlook VBA and Custom Forms 3
S Need code to allow defined starting folder and selection from there to drill down Outlook VBA and Custom Forms 10
P Emails assigned with a certain category (within a shared inbox) to be copied to a specific folder. Outlook VBA and Custom Forms 2
M Saving emails using Visual Basic - Selecting folder with msoFileDialogFolderPicker Outlook VBA and Custom Forms 6
B Search and Find Email by Folder Name Outlook VBA and Custom Forms 2
S Folder Pane Colour Categories Using Outlook 6
Victor.Ayala Automated way to check the option "Show this folder as an email Address Book" Outlook VBA and Custom Forms 2
NVDon Create new Move To Folder list Outlook VBA and Custom Forms 0
M Extract "Date sent" from emails (saved to folder using drag and drop) Outlook VBA and Custom Forms 1
O Cannot expand the folder. The set of folders cannot be opened. You do not have permission to log on. Using Outlook 1
F Jump to Inbox folder when click on Favorite Using Outlook 8
P Print attachments automatically and move the mail to an existing folder called "Ted" Outlook VBA and Custom Forms 4
lcarpay Stay in the mail folder pane after ctrl-1 Using Outlook 1
T Macro to move reply and original message to folder Outlook VBA and Custom Forms 6
F VBA to move email from Non Default folder to Sub folders as per details given in excel file Outlook VBA and Custom Forms 11
bhamberg Shortcuts in Folder Pane (Outlook 2016) Using Outlook 19
G VBA to save selected Outlook msg with new name in selected network Windows folder Outlook VBA and Custom Forms 1
P Posts in Folder No Longer Group by Conversation Column After Search Using Outlook 0
Y Filter unread emails in a search folder vba help Outlook VBA and Custom Forms 0
N contact list seen in Contact folder but knot in Address book or when 'TO' button is clicked in new email Using Outlook 0
D How to remove a folder, option grayed out Using Outlook 4
D How To Combine Share Task Folders in just one Folder Using Outlook 0
G Retention Policy for Outlook.com Deleted Items folder Using Outlook 0
Z Outlook 365 delete reminder you can’t make change to contents of this-read only folder Using Outlook 4
O The Outlook API wrongfully shows an outlook folder to have zero sub-folders Outlook VBA and Custom Forms 1
O The Outlook API wrongfully shows an outlook folder to have zero sub-folders Outlook VBA and Custom Forms 2
S Outlook (2016 32bit; Gmail IMAP) - Save sent message to Outllook Folder Outlook VBA and Custom Forms 0
D Move Email with Attachment to Folder Outlook VBA and Custom Forms 3
C VBA to prompt for Sent folder destination Outlook VBA and Custom Forms 3
G How to add a folder shortcut to outlook quick access toolbar? Using Outlook 6
G Add to Outlook Contacts - Point to non-default contacts folder Using Outlook 0
M Move to Folder Using Outlook 1
K Export Folder to PST Outlook VBA and Custom Forms 2
B Spam folder not showing in Outlook Using Outlook 5
D Is a sub folder under contacts necessary to be able to name an Address Book? Using Outlook 1
J Moved many emails to Outlook external folder, need to delete on Gmail server Using Outlook 14
A Going to folder using shortcuts Using Outlook 3
B Outlook 2016 Auto-archive creates new folder Using Outlook 3
Fozzie Bear Outlook 2016 Creating a shared local Contacts folder Using Outlook 2
A Cannot copy this folder because it may contain private items Using Outlook 0
A Unable to save recurring Meeting to Documents folder due to error Using Outlook 2
B Extracting email addresses from a folder - how to also get the name of the person the address is for? Using Outlook 5
E How to display "Change Folder" in Change Default Email Delivery Location in Exchange Outlook 2016 Using Outlook 1
J Moving Imported folder Using Outlook 2

Similar threads

Top