![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I am trying to make something happen in Outlook 2007 that was natural in
Outlook 2003. In OL 2003, I could expose the Categories field in a message list and simply type in categories. I use hundreds of categories (instead of folders), so the nice colorized popup category menu in OL2007 is actually too inefficient for my purposes. I tried to hack a macro (below), which only works on the first item of the selection. Was wondering what I could do to make this work correctly/better? ' an attempt to quickset categories from an input box interface, something ' that I used to be able to do easily in Outlook2003 ' Public Sub SetCat() Dim myOlApp As New Outlook.Application Dim myOlExp As Outlook.Explorer Dim myfolder As Outlook.MAPIFolder Dim myOlSel As Object Dim MsgTxt As String Dim x As Integer MsgTxt = InputBox("Enter Categories (comma separated)", "Macro to Set Categories", "HOT") Set myOlExp = myOlApp.ActiveExplorer Set myOlSel = myOlExp.Selection For x = 1 To myOlSel.count myOlSel.Item(x).Categories = MsgTxt Next x DoEvents End Sub |
Ads |
#2
|
|||
|
|||
![]() Before the loop moves on to the next item, you need to call the item's Save method. -- Best regards Michael Bauer - MVP Outlook : VBOffice Reporter for Data Analysis & Reporting : Outlook Categories? Category Manager Is Your Tool : http://www.vboffice.net/product.html?pub=6&lang=en Am Mon, 8 Sep 2008 13:37:01 -0700 schrieb JIMBOLUKE: I am trying to make something happen in Outlook 2007 that was natural in Outlook 2003. In OL 2003, I could expose the Categories field in a message list and simply type in categories. I use hundreds of categories (instead of folders), so the nice colorized popup category menu in OL2007 is actually too inefficient for my purposes. I tried to hack a macro (below), which only works on the first item of the selection. Was wondering what I could do to make this work correctly/better? ' an attempt to quickset categories from an input box interface, something ' that I used to be able to do easily in Outlook2003 ' Public Sub SetCat() Dim myOlApp As New Outlook.Application Dim myOlExp As Outlook.Explorer Dim myfolder As Outlook.MAPIFolder Dim myOlSel As Object Dim MsgTxt As String Dim x As Integer MsgTxt = InputBox("Enter Categories (comma separated)", "Macro to Set Categories", "HOT") Set myOlExp = myOlApp.ActiveExplorer Set myOlSel = myOlExp.Selection For x = 1 To myOlSel.count myOlSel.Item(x).Categories = MsgTxt Next x DoEvents End Sub |
#3
|
|||
|
|||
![]()
Thanks, I have a workable implementation now for a mass category entry tool!
I drug the macro onto the primary toolbar, renamed it to "&K" (which allows me to activate it with "Alt-K"), and I'm off to the races. I'd like to improve it further (like eliminating duplicates, having something that actually autocompletes from a list of categories, etc), but I do have a makeshift solution. ' SetCat() - 20080908a ' ' an attempt to quickset categories from an input box interface, something ' that I used to be able to do easily in Outlook2003 ' ' ' routine simply appends a user-inputted string to the categories field ' but does not eliminate duplicates. OL2007 apparently doesn't prevent you ' from putting redundant categories ' ' Public Sub SetCat() Dim myOlApp As New Outlook.Application Dim myOlExp As Outlook.Explorer Dim myfolder As Outlook.MAPIFolder Dim myOlSel As Object Dim MsgTxt As String Dim x As Integer MsgTxt = InputBox("Enter Categories (comma separated)", "Macro to Set Categories", "HOT") Set myOlExp = myOlApp.ActiveExplorer Set myOlSel = myOlExp.Selection For x = 1 To myOlSel.count If myOlSel.Item(x).Categories = "" Then myOlSel.Item(x).Categories = MsgTxt Else myOlSel.Item(x).Categories = myOlSel.Item(x).Categories & "," & MsgTxt End If myOlSel.Item(x).Save Next x DoEvents End Sub "Michael Bauer [MVP - Outlook]" wrote: Before the loop moves on to the next item, you need to call the item's Save method. |
#4
|
|||
|
|||
![]() If you're interested in improving your work with categories, you might also test Category Manager. For details and the free download please see the link in my signature. -- Best regards Michael Bauer - MVP Outlook : VBOffice Reporter for Data Analysis & Reporting : Outlook Categories? Category Manager Is Your Tool : http://www.vboffice.net/product.html?pub=6&lang=en Am Tue, 9 Sep 2008 07:23:01 -0700 schrieb JIMBOLUKE: Thanks, I have a workable implementation now for a mass category entry tool! I drug the macro onto the primary toolbar, renamed it to "&K" (which allows me to activate it with "Alt-K"), and I'm off to the races. I'd like to improve it further (like eliminating duplicates, having something that actually autocompletes from a list of categories, etc), but I do have a makeshift solution. ' SetCat() - 20080908a ' ' an attempt to quickset categories from an input box interface, something ' that I used to be able to do easily in Outlook2003 ' ' ' routine simply appends a user-inputted string to the categories field ' but does not eliminate duplicates. OL2007 apparently doesn't prevent you ' from putting redundant categories ' ' Public Sub SetCat() Dim myOlApp As New Outlook.Application Dim myOlExp As Outlook.Explorer Dim myfolder As Outlook.MAPIFolder Dim myOlSel As Object Dim MsgTxt As String Dim x As Integer MsgTxt = InputBox("Enter Categories (comma separated)", "Macro to Set Categories", "HOT") Set myOlExp = myOlApp.ActiveExplorer Set myOlSel = myOlExp.Selection For x = 1 To myOlSel.count If myOlSel.Item(x).Categories = "" Then myOlSel.Item(x).Categories = MsgTxt Else myOlSel.Item(x).Categories = myOlSel.Item(x).Categories & "," & MsgTxt End If myOlSel.Item(x).Save Next x DoEvents End Sub "Michael Bauer [MVP - Outlook]" wrote: Before the loop moves on to the next item, you need to call the item's Save method. |
#5
|
|||
|
|||
![]()
Thanks, looks like fun, but I don't have admin privileges (though I can run
risky macros) so it wouldn't install ![]() darnit "Michael Bauer [MVP - Outlook]" wrote: If you're interested in improving your work with categories, you might also test Category Manager. For details and the free download please see the link in my signature. -- Best regards Michael Bauer - MVP Outlook : VBOffice Reporter for Data Analysis & Reporting : Outlook Categories? Category Manager Is Your Tool : http://www.vboffice.net/product.html?pub=6&lang=en Am Tue, 9 Sep 2008 07:23:01 -0700 schrieb JIMBOLUKE: Thanks, I have a workable implementation now for a mass category entry tool! I drug the macro onto the primary toolbar, renamed it to "&K" (which allows me to activate it with "Alt-K"), and I'm off to the races. I'd like to improve it further (like eliminating duplicates, having something that actually autocompletes from a list of categories, etc), but I do have a makeshift solution. ' SetCat() - 20080908a ' ' an attempt to quickset categories from an input box interface, something ' that I used to be able to do easily in Outlook2003 ' ' ' routine simply appends a user-inputted string to the categories field ' but does not eliminate duplicates. OL2007 apparently doesn't prevent you ' from putting redundant categories ' ' Public Sub SetCat() Dim myOlApp As New Outlook.Application Dim myOlExp As Outlook.Explorer Dim myfolder As Outlook.MAPIFolder Dim myOlSel As Object Dim MsgTxt As String Dim x As Integer MsgTxt = InputBox("Enter Categories (comma separated)", "Macro to Set Categories", "HOT") Set myOlExp = myOlApp.ActiveExplorer Set myOlSel = myOlExp.Selection For x = 1 To myOlSel.count If myOlSel.Item(x).Categories = "" Then myOlSel.Item(x).Categories = MsgTxt Else myOlSel.Item(x).Categories = myOlSel.Item(x).Categories & "," & MsgTxt End If myOlSel.Item(x).Save Next x DoEvents End Sub "Michael Bauer [MVP - Outlook]" wrote: Before the loop moves on to the next item, you need to call the item's Save method. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
macro to assign category to new email | [email protected] | Outlook - General Queries | 7 | July 30th 08 11:18 PM |
updated to 2007 and can't assign colors to exisiting categories | Candace | Outlook - Using Contacts | 1 | October 7th 07 09:22 AM |
can't assign macro | [email protected] | Outlook and VBA | 1 | July 24th 07 03:23 PM |
Categories auto assign | baileyalexander | Outlook - Calandaring | 2 | March 25th 07 02:23 AM |
assign macro to custom toolbar button | Rod Nolan | Outlook and VBA | 1 | September 7th 06 06:34 AM |