using outlook 2007 categories through gmail

Status
Not open for further replies.
D

dan knock

hi everyone,

I would like to find a way to keep outlook 2007 categories through gmail.

Gmail use label which are show as folders in outlook.

So it's "simple": when I put a category to an email, a script could copy this email to the right mapi folder in Gmail.

in others PCs a script could put automatically a category to every email which are into this folder:

ex: I put "urgent" category to an email ->copy this email to "urgent" gmail folder

and then: in others PCs every email in "urgent" gmail folder could set to "urgent" category.

the only pb... I don't know how to do that in VBA for outlook 2007.

Someone could help me ?

I'm convinced that many other users could be interested.

greeting.
 
D

dan knock

I've found this:

It move every categorised email to a specific folder (urgent ou boulot).

beware: this script freeze outlook a long time to achieve the operation.

I need to link it with the event "user has check a new email in a specific folder"... if you know how, tell me :)

Sub MoveItems()

Dim myNamespace As Outlook.NameSpace

Dim myFolder As Outlook.Folder

Dim myItems As Outlook.Items

Dim myRestrictItems As Outlook.Items

Dim myItem As Outlook.MailItem

Dim racine As Outlook.Folder

Set myNamespace = Application.GetNamespace("MAPI")

Set myFolder = _

myNamespace.GetFolderFromID(ActiveExplorer.CurrentFolder.EntryID)

Set myItems = myFolder.Items

Set racine = myFolder.Parent

Set myRestrictItems = myItems.Restrict("[Catégories] = 'urgent ou boulot'")

For i = myRestrictItems.Count To 1 Step -1

myRestrictItems(i).Move racine.Folders("urgent ou boulot")

Next

End Sub
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
This example moves an item as soon as you categorize it. You could adopt it,

and just copy the item instead:

http://www.vboffice.net/en/developers/trigger-actions-with-categories

This one shows how to assign a category as soon as it gets into a certain

folder:

http://www.vboffice.net/en/developers/categorize-emails-automatically

If you know exactly how many folders you want to watch, you could use one

Items variable for each. For instance:

Private WithEvents Items_1 As Outlook.Items

Private WithEvents Items_2 As Outlook.Items

etc.

In Application-Startup you'd have to set every of these variables to the

Items collection of one folder.

Best regards

Michael Bauer

Am Mon, 01 Mar 2010 12:44:16 -0500 schrieb dan knock:


> I've found this:
> It move every categorised email to a specific folder (urgent ou boulot).
> beware: this script freeze outlook a long time to achieve the operation.
> I need to link it with the event "user has check a new email in a specific


folder"... if you know how, tell me :)

> Sub MoveItems()
> Dim myNamespace As Outlook.NameSpace
> Dim myFolder As Outlook.Folder
> Dim myItems As Outlook.Items
> Dim myRestrictItems As Outlook.Items
> Dim myItem As Outlook.MailItem
> Dim racine As Outlook.Folder

> Set myNamespace = Application.GetNamespace("MAPI")
> Set myFolder = _
> myNamespace.GetFolderFromID(ActiveExplorer.CurrentFolder.EntryID)

> Set myItems = myFolder.Items
> Set racine = myFolder.Parent
> Set myRestrictItems = myItems.Restrict("[Catégories] = 'urgent ou


boulot'")

> For i = myRestrictItems.Count To 1 Step -1
> myRestrictItems(i).Move racine.Folders("urgent ou boulot")
> Next
> End Sub
> .
>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
P Outlook 2007 Email Categorization using VBA Outlook VBA and Custom Forms 1
R Using Internet Calendar in Outlook 2007 within Citrix Using Outlook 1
T Using Outlook 2007 with Comcast (.pst inbox issue) Using Outlook 1
S Can't send messages using Outlook 2007 from a business email Using Outlook 3
K Outlook 2007 using in office and at home Using Outlook 1
J IPAD Outlook OWA App - Help using Exchange 2007 Using Outlook 4
D folders are missing using imap outlook 2007 Using Outlook 1
F Using Outlook 2007 as an IMAP Mail Station Without Saving Data Locally Using Outlook 2
M Scared to lose data using iCloud with Outlook 2007 Using Outlook 2
M Syncing using iCloud mangled my Outlook 2007 file Using Outlook 2
M Unable to send email to gmail - using Outlook 2007 Using Outlook 3
L How can I delete stationery from Actions, New Mail Message Using in outlook 2007? Using Outlook 6
S Sending Email from Access 2007 through Outlook 2007 using template Outlook VBA and Custom Forms 13
C Not able to send emails with Outlook 2007 using Vista BCM (Business Contact Manager) 1
S Outlook 2007 error message using the TASK feature Using Outlook 6
J Outlook 2007 using custom form created for Outlook 2003 Outlook VBA and Custom Forms 2
S save attachment using outlook 2007 Outlook VBA and Custom Forms 1
M Disable Contact Card Results when using "Search People" in Outlook Ribbon Using Outlook 7
S Outlook VBA How to adapt this code for using in a different Mail Inbox Outlook VBA and Custom Forms 0
pcunite Outlook 2019/O365 Build 13127.20408 errors when using MAPI calls Using Outlook 1
M Outlook 2013 reminder email by using Outlook vba Outlook VBA and Custom Forms 2
X Using Outlook 2013 and Outlook 365 Using Outlook 1
A Outlook replies not using "delivered to" address in From Using Outlook 1
O Email not leaving Outbox when using Excel VBA to sync Outlook account Outlook VBA and Custom Forms 4
K Using Outlook 2016 to draw Using Outlook 1
O Outlook 365 - suddenly unable to send using Gmail POP3 Using Outlook 10
G Outlook 2016 sync contacts directly between phone and computer using outlook 2016 Using Outlook 0
L Moving emails with similar subject and find the timings between the emails using outlook VBA macro Outlook VBA and Custom Forms 1
S Find a cell value in excel using outlook vba Using Outlook 1
S Macro using .SendUsingAccount only works the first time, after starting Outlook Outlook VBA and Custom Forms 4
D create an html table in outlook custom form 2010 using vba in MsAccess Outlook VBA and Custom Forms 7
B query outlook using vba Outlook VBA and Custom Forms 13
A Forward Outlook Email by Filtering using Macro Rule Outlook VBA and Custom Forms 44
S Outlook [Online - Office365] perfomance is getting affected when accessing the mails using Redemptio Using Outlook 1
M Using Outlook with Yahoo email Using Outlook 6
D send email from Excel using outlook template Outlook VBA and Custom Forms 3
R Using Multiple Accounts in Outlook Using Outlook 3
P MS OFFICE 2013 - Outlook locking up when using the sent on behalf of feature in VB Using Outlook 3
Diane Poremsky Using Outlook Links New Slipstick.com Articles 0
Diane Poremsky Using Arrays in Outlook macros New Slipstick.com Articles 0
Diane Poremsky Using the Outlook Calendar Template New Slipstick.com Articles 0
N Going Forward: Using Outlook 2016 for RSS Feeds Using Outlook 2
Diane Poremsky Using Scanpst in Outlook Click to Run New Slipstick.com Articles 0
F Avoid sending duplicate using Outlook script Outlook VBA and Custom Forms 2
J Unable to link email messages in BCM using a single microsoft office 365 account in outlook 2013 BCM (Business Contact Manager) 1
Diane Poremsky Using Outlook's New Contact Cards New Slipstick.com Articles 0
J Outlook 2013 how to convert 2013 OST file into an another format, i m using outlook 2013 versions. Using Outlook 1
G Adding a contact to Outlook with a custom form using Access VBA Outlook VBA and Custom Forms 1
S using script rule to save attachments on arrival Outlook 2010 Outlook VBA and Custom Forms 9
Christian Using Outlook's New Contact Cards New Slipstick.com Articles 4

Similar threads

Top