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

Set Categories macro



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old November 20th 06, 02:25 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 7
Default Set Categories macro

This macro should add specified categorie to each email I have
selected, but nothing happens. What could be wrong?

/Marcus

----------------------------------------
Sub SetCategories()
' Set "Local" Category to email
Dim myItem As Object
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection
NewCategories = InputBox("Specify Category new categorie", "Specify
Category...", "Miscellaneous")
On Error Resume Next
'Work on selected items
Set myOlExp = myOlApp.ActiveExplorer
Set myOlSel = myOlExp.Selection
'For all items do...
For Each myItem In myOlSel
'Set categories
myItem.Categories = myItem.Categories & ";" & NewCategories
myItem.Save
Next
'Free variables
Set myItem = Nothing
Set myOlApp = Nothing
Set myOlExp = Nothing
Set myOlSel = Nothing
End Sub
----------------------------------------

 




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
Automatically set categories on events [email protected] Outlook - General Queries 1 September 21st 06 03:50 AM
Tasks categories. Unable to modify another user's categories. Tommy Outlook - Installation 0 August 9th 06 04:43 PM
Set Warnings Macro Donbenz Outlook and VBA 7 June 2nd 06 06:26 PM
Organizing contacts in folder by categories - new categories missi Annie Best Outlook - Using Contacts 5 May 16th 06 03:26 PM
Macro - Update Contacts - Categories Chris_Texas Outlook and VBA 4 February 21st 06 06:37 AM


All times are GMT +1. The time now is 07:48 AM.


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.