A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

using outlook 2007 categories through gmail



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 1st 10, 01:36 PM posted to microsoft.public.outlook.program_vba
dan knock
external usenet poster
 
Posts: 2
Default using outlook 2007 categories through gmail

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.
Submitted using http://www.outlookforums.com
Ads
  #2  
Old March 1st 10, 05:44 PM posted to microsoft.public.outlook.program_vba
dan knock
external usenet poster
 
Posts: 2
Default using outlook 2007 categories through gmail

I've found this:
It move every categorised email to a specific folder (urgent ou boulot).
bewa 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.Current Folder.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
  #3  
Old March 2nd 10, 08:27 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default using outlook 2007 categories through gmail



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/sample.html?...0&cmd=showitem

This one shows how to assign a category as soon as it gets into a certain
folder:
http://www.vboffice.net/sample.html?...2&cmd=showitem

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 - MVP Outlook
Manage and share your categories:
http://www.vboffice.net/product.html?pub=6&lang=en


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).
bewa 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.Current Folder.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
.
Submitted using http://www.outlookforums.com

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
GMail and Outlook 2007 Sachin Jain Outlook - General Queries 2 January 19th 10 09:10 AM
Outlook 2007 and Gmail Jean Pierre Outlook - Installation 2 May 4th 07 10:21 PM
can send gmail in outlook but cannot receive gmail, what's the pr. Jerm Outlook - Installation 1 April 16th 07 02:03 PM
How do I set up gmail on Outlook 2007 Larry S Outlook - General Queries 2 March 13th 07 04:16 PM
Outlook 2007 Categories are a combo of Categories & Labels in 2003 Scott Sherman Outlook - Calandaring 0 February 13th 07 04:23 AM


All times are GMT +1. The time now is 07:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.