Results 1 to 3 of 3

Thread: using outlook 2007 categories through gmail

  1. #1
    dan knock Guest

    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

  2. #2
    dan knock Guest

    Default Re: using outlook 2007 categories through gmail

    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.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. #3
    Michael Bauer [MVP - Outlook] Guest

    Default Re: 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).
    > 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.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


Similar Threads

  1. Replies: 2
    Last Post: 11-09-2010, 02:40 PM
  2. Outlook 2007 and gmail
    By guymagno in forum Using Outlook
    Replies: 2
    Last Post: 10-22-2010, 06:39 AM
  3. GMail and Outlook 2007
    By Sachin Jain in forum Using Outlook
    Replies: 2
    Last Post: 01-19-2010, 03:10 AM
  4. Outlook 2007 / Gmail import set up
    By Craig in forum Using Outlook
    Replies: 1
    Last Post: 11-10-2009, 10:14 PM
  5. Qwest and gmail with outlook 2007
    By GAT in forum Using Outlook
    Replies: 2
    Last Post: 08-31-2009, 01:54 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
  •