Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / February 2004

Tip: Looking for answers? Try searching our database.

Second go round on assigning categories with Macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KdBrown - 27 Feb 2004 13:39 GMT
A week or so ago, I had asked a question on how to assign
categories to emails and I got a great answer based on what
I had asked.  Since that time, I have found that I missed a
necessary requirment the appointment items I get that I
also need to categorize.  

So to recap, I am looking for a way to assign categories to
emails (and appointment items) through a macro.  I can
currently select several emails (and appointment items) in
my inbox, then right click and select categories, then
select the category I want, but what I would like to do is
create a macro which I can place in a toolbar.  When I
select items in my inbox, I would then go to the toolbar,
and select the correct button to assign them to the
appropriate category.

    What I got back then and am currently using is as follows:

    Sub AssignDepartment()
    'Assigns the selected email items to the DepartmentCategory

    Dim oSel As Outlook.Selection
    Dim oMail As Outlook.MailItem

    Set oSel = Application.ActiveExplorer.Selection
    For Each oMail In oSel
       oMail.Categories = "Department"
       oMail.Save
    Next
    End Sub

Is there a way to modify this to include Outlook.MailItem
as well as Outlook.AppointmentItem?

Thanks
KdBrown
Sue Mosher [MVP-Outlook] - 27 Feb 2004 14:22 GMT
Dim oMail as Object not Outlook.MailItem
Signature

Sue Mosher, Outlook MVP
Author of
    Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> A week or so ago, I had asked a question on how to assign
> categories to emails and I got a great answer based on what
[quoted text clipped - 32 lines]
> Thanks
> KdBrown
- 27 Feb 2004 15:30 GMT
Thanks, now I just have to modify all my macros!

KdBrown

>-----Original Message-----
>Dim oMail as Object not Outlook.MailItem
[quoted text clipped - 36 lines]
>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.