Gmail / Gsuite in VSTO Addin

Add-in Express™ Support Service
That's what is more important than anything else

Gmail / Gsuite in VSTO Addin
Gmail / Gsuite in VSTO Addin 
TheNewCOMAddin Dev




Posts: 26
Joined: 2019-07-11
Hi Guys,

Note : this question may not be specific to ADX but seeking help from all places I can. Thanks in advance.

We are working on a VSTO addin that finally targets all users not just outlook / office.
Now, specifically for Gsuite we see that after you enable IMAP and add the account in gmail.
The labels added get converted to Folders and the emails get listed under specific folder.

Now, as COM Addin dev I have following questions :
1) First of all how to we know the "provider" is Gmail / Gsuite ?
Specifically how do we get this info if this a gsuite account where the email may not contain "@gmail" ?

2) How can I get the labels added to a specific email ? Is there any COM property that lists this. I checked "MailItem.Categories" but that does not have any info.

Thanks again.
Posted 09 Jan, 2020 05:54:10 Top
Andrei Smolin


Add-in Express team


Posts: 17243
Joined: 2006-05-11
Hello,

I assume you talk about a VSTO add-in supporting multiple Office applications and Outlook is among them. Also I assume you talk about a scenario in which the user adds an IMAP Folder message store which is linked to GMail. And you need to identify that scenario.

If the above understanding is correct, you need to scan the Accounts collection (available in Outlook 2007+) and check the Account.DeliveryStore to find out the message store where GMail delivers its emails.

TheNewCOMAddin Dev writes:
The labels added get converted to Folders and the emails get listed under specific folder.


I don't understand what you do, what you you need to achieve and what you achieve instead. What are "the labels"? How do they convert to folders? "the emails get listed under specific folder" - doesn't this always work in this exact way?

TheNewCOMAddin Dev writes:
How can I get the labels added to a specific email ?


What are "the labels"?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader

PS. I ask you to respond to the email I sent you yesterday.
Posted 09 Jan, 2020 06:22:02 Top
TheNewCOMAddin Dev




Posts: 26
Joined: 2019-07-11
Hi Andrie,

You are right in all your assumptions - its a outlook VSTO Addin and yes I am trying to add a gmail account in outlook post enabling IMAP in account settings. Apologies for any confusion and thanks for adding those here.

I don't understand what you do, what you you need to achieve and what you achieve instead

Well, I am just trying to check if the account is a gmail / gsuite and just get the labels (see below) given to a mailItem and then act according to that (Show Hide a ADXForm in a ADXFormCollection).

What are "the labels"?

kindly read this to understand labels : https://support.google.com/mail/answer/118708?co=GENIE.Platform%3DDesktop&hl=en

To explain briefly on labels: I think this to be google/gmail's equivalent to "Categories" in Outlook.

How do they convert to folders? "the emails get listed under specific folder" - doesn't this always work in this exact way??

Now, I don't exactly know the internals but it just "shows" those labeled emails (which I do from gmail.com) under heads (with label name) that appear as folders in my outlook. Yes it work exactly the same way everytime. If I create new labels and add them to emails in my gmail. I can see those changes reflect in Outlook: they are seen as folders and whenI click them I can see those emails that I added label to in gmail.com.


Thanks again.
Posted 09 Jan, 2020 07:09:31 Top
Andrei Smolin


Add-in Express team


Posts: 17243
Joined: 2006-05-11
TheNewCOMAddin Dev writes:
To explain briefly on labels: I think this to be google/gmail's equivalent to "Categories" in Outlook.


I don't know how Google developers "map" the labels to the entities that Outlook provides. This should be described in the manual(s) they provide. If they map labels to categories, have a look at Namespace.Categories and Store.Categories.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Jan, 2020 07:25:58 Top
TheNewCOMAddin Dev




Posts: 26
Joined: 2019-07-11
Thanks again Andrei. Will check this.
Posted 10 Jan, 2020 07:19:53 Top
Andrei Smolin


Add-in Express team


Posts: 17243
Joined: 2006-05-11
You are welcome.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 10 Jan, 2020 08:11:28 Top