I try to assign category based on subject in appointment (code included)

Below i wrote code to assign a categorie to a calendar item based on the word "vrij" in the subject.
I think this code should work.. but somehow it doesnt
I use Outlook 2003 with macro security set to lowest level. The code is placed in  "this outlook session"
Any ideas why it doesnt work ??

====================================================

Dim WithEvents colRDVItems As Items
 
Private Sub Application_Startup()
Dim NS As Outlook.NameSpace
Set NS = Application.GetNamespace("MAPI")
Set colRDVItems = NS.GetDefaultFolder(olFolderCalendar).Items
Set NS = Nothing
End Sub

Private Sub colRDVItems_ItemAdd(ByVal Item As Object)

    If Item.Class = olAppointment Then
        If InStr(LCase(Item.Subject), "vrij") > 1 Then
            AddCat Item, "Holiday"
            Item.Save
        End If
    End If
End Sub
0
PGT (9)
12/22/2009 12:39:58 PM
outlook.general 7254 articles. 3 followers. Follow

3 Replies
1381 Views

Similar Articles

[PageSpeed] 31

The programming group is 'down the hall' at microsoft.public.program_vba.
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba&lang=en&cr=US

Is there a reason you are using VBA instead of rules?

-- 
Diane Poremsky [MVP - Outlook]
Outlook Tips: http://www.outlook-tips.net/
Outlook & Exchange Solutions Center: http://www.slipstick.com/

Outlook Tips by email:
mailto:dailytips-subscribe-request@lists.outlooktips.net

EMO - a weekly newsletter about Outlook and Exchange:
mailto:EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM

Poll: What version of Outlook do you use?
http://forums.slipstick.com/showthread.php?t=27072


"PGT" <user@msgroups.net/> wrote in message 
news:e2A9ePwgKHA.5528@TK2MSFTNGP05.phx.gbl...
> Below i wrote code to assign a categorie to a calendar item based on the 
> word "vrij" in the subject.
> I think this code should work.. but somehow it doesnt
> I use Outlook 2003 with macro security set to lowest level. The code is 
> placed in  "this outlook session"
> Any ideas why it doesnt work ??
>
> ====================================================
>
> Dim WithEvents colRDVItems As Items
>
> Private Sub Application_Startup()
> Dim NS As Outlook.NameSpace
> Set NS = Application.GetNamespace("MAPI")
> Set colRDVItems = NS.GetDefaultFolder(olFolderCalendar).Items
> Set NS = Nothing
> End Sub
>
> Private Sub colRDVItems_ItemAdd(ByVal Item As Object)
>
>    If Item.Class = olAppointment Then
>        If InStr(LCase(Item.Subject), "vrij") > 1 Then
>            AddCat Item, "Holiday"
>            Item.Save
>        End If
>    End If
> End Sub
>
> ---
> frmsrcurl: http://msgroups.net/microsoft.public.outlook.general/ 

0
Diane
12/22/2009 1:12:40 PM
yes i got to automate it with many keywords.
and it has to be done for a lot of people, keeping it in code should simply this.

so shown above "vrij" is just one keyword but, if this works then next i can add all other words and i can automate more, its part of something bigger.
0
PGT (9)
12/22/2009 1:18:00 PM
Ok. Then VBA makes sense. Try the programmer group - the VBA experts hang 
out there.

-- 
Diane Poremsky [MVP - Outlook]
Outlook Tips: http://www.outlook-tips.net/
Outlook & Exchange Solutions Center: http://www.slipstick.com/

Outlook Tips by email:
mailto:dailytips-subscribe-request@lists.outlooktips.net

EMO - a weekly newsletter about Outlook and Exchange:
mailto:EMO-NEWSLETTER-SUBSCRIBE-REQUEST@PEACH.EASE.LSOFT.COM

Poll: What version of Outlook do you use?
http://forums.slipstick.com/showthread.php?t=27072


"PGT" <user@msgroups.net/> wrote in message 
news:#3vyvkwgKHA.2104@TK2MSFTNGP05.phx.gbl...
> yes i got to automate it with many keywords.
> and it has to be done for a lot of people, keeping it in code should 
> simply this.
>
> so shown above "vrij" is just one keyword but, if this works then next i 
> can add all other words and i can automate more, its part of something 
> bigger.
>
> ---
> frmsrcurl: 
> http://msgroups.net/microsoft.public.outlook.general/I-try-to-assign-category-based-on-subject-in-appointment-code- 

0
Diane
12/22/2009 1:23:15 PM
Reply:

Similar Artilces:

Workflow queston
Here is the scneario: A manager creates manually creates a lead, and assigns it to a Salesman. Upon assigning, I would like to create some kind of activity/task or something... which appears in their workplace 5 days from now, so that they can come and check if the salesperson has done any work with the lead. I tried workflow, and creating a task and assigning to the manager. But what happens is that ... once the ownership changes with assignment, the task shows up in new owner workflow... regardless of me assigning the task to manager. if someone has any other ideas, by which ...

How do I delete rows based upon the content (without sorting the .
After importing an ASCII print file, I'm now trying to get rid of the headers and footers. Any suggestions on how to do this in a automated fashion? Try something like this: http://www.vbaexpress.com/kb/getarticle.php?kb_id=20 **** Hope it helps! **** ~Dreamboat Excel VBA Certification Coming Soon! www.VBAExpress.com/training/ ******************************** "cev" <cev@discussions.microsoft.com> wrote in message news:5C114D60-7FED-4B5E-BDCE-96F803BC83E5@microsoft.com... > After importing an ASCII print file, I'm now trying to get rid of the headers > and ...

trying this out
This is a test posting. On Tue, 13 Nov 2007 16:06:51 +0800, "hmmmm" <bobo123@dotdot.dyndns.org> wrote: >This is a test posting. > Please use microsoft.public.test or microsoft.public.test.here for your testing. This is a working newsgroup. If you have questions about an Access database, please post them. John W. Vinson [MVP] ...

I am trying to round up to the nearest 25 cents
I am trying to round a money value to the nearsest 25 cents and it keeps rounding to the nearest dollar HELP Try =CEILING(A1, 0.25) In article <2DB8F007-1E27-4A48-923B-C7D4D0238B5E@microsoft.com>, sypher <sypher@discussions.microsoft.com> wrote: > I am trying to round a money value to the nearsest 25 cents and it keeps > rounding to the nearest dollar HELP =ROUND(A1*4,0)/4 -- HTH Bob Phillips "sypher" <sypher@discussions.microsoft.com> wrote in message news:2DB8F007-1E27-4A48-923B-C7D4D0238B5E@microsoft.com... > I am trying to round a mone...

Reflect changes based on field choice
On my form I have a field called amount and a field called Checkstatus. The amount signifies a check amount and status signifiespending, returned or cleared. Is it possible that when cleared isselected a calculation will automatically reflect the change .Example:Available Balance $5000Check Amount Status$3000 PendingBalance reflects $2000 availableCheck Amount Status$3000 ClearedBalnce reflects $5000I know in excel I would achieve this with an IF function however I amsomewhat lost in AccessTIA Use an expression in a query to get the result of the ...

Linking to an appointment's required attendees
I have a report that pulls appointment records and I need to list and select on the required attendees. I can't see how to get this info by using CRM's views. It looks like they're held in the ActivityPartyBase table, but since we're always cautioned to use the views, it seems there should be an easier way than linking to the table directly and using the ParticipationTypeMask field. ...

Trying to clear up Received but not invoiced report
I am trying to clean up the received not invoiced items. The problem began with entering a purchase order and then not matching the invoice to the items received agaisnt the purchase order. SO we thought that doing a returned transaction entery would solve the problem. The only thing is now the return shows up on our Received/ Not invoiced report. And the report is becoming a huge mess and difficult to use. What is the best way to clear up items that have been received but were not matched and already paid through the invoice entery? There is a knowledgebase article on this very thing av...

"You can't assign a value to this object"
A user got this error while connected via VPN. The statement was: Me!txtLECDate = Now() The control was on the current screen and not locked or disabled. Any idea what could have caused this? ...

Mailbox Limit based on Time Interval
Hi All, I am looking for some help in setting a mailbox limit based on a time interval. Mainly I would like to delete all messages from all mailboxes on an Exchange 2003 Standard server that are over 6 months old (automatically). I know I can set limits on mailbox size, individually and globally, but we have some users who need a large size to send/receive large attachments. Any help in pointing me in the right direction would be greatly appreciated. Jeff Jeff: What you are looking for can be found under Recipient Policies. You want to create a recipient policy that includes the ...

How do I change the Product Key code and the User name of Microsoft Office 2008 once installed on Mac OSX 10.5.1?
How do I change the Product Key code and the User name of Microsoft Office 2008 once installed on Mac OSX 10.5.1? On 2/26/08 5:15 PM, in article ee8ee56.-1@webcrossing.caR9absDaxw, "mollycat@officeformac.com" <mollycat@officeformac.com> wrote: > How do I change the Product Key code and the User name of Microsoft Office > 2008 once installed on Mac OSX 10.5.1? Delete these two files: ~:Library:Preferences:Microsoft:Office 2008:Microsoft Office 2008 Settings.plist where ~ is your home folder, and HD:Applications:Microsoft Office 2008:Office:OfficePID.plist -- Diane, ...

Error Code :0x80040605
Outlook asked me to upgrade the Connector when i choose to repair, nothing happened except that my email account could not sign in and when i choose remove the outlook connector automatically removed. Troubleshooting Outlook Hotmail Connector - http://www.officeforlawyers.com/outlook/tsol.htm#hm -- -Ben- Ben M. Schorr, MVP Roland Schorr & Tower http://www.rolandschorr.com http://www.officeforlawyers.com/outlook.htm Author: The Lawyer's Guide to Microsoft Outlook 2007: http://tinyurl.com/ol4law-amazon "Karen" <Karen@discussions.microsoft.com> wr...

Import Customer Address Codes
This is a multi-part message in MIME format. ------=_NextPart_000_0016_01C4AF86.06A60AC0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0017_01C4AF86.06A60AC0" ------=_NextPart_001_0017_01C4AF86.06A60AC0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable BlankI was wondering if there is a way to import address codes for one = of our customers? Currently, for this customer I have one bill to = location and 2 ship to locations. But we just sold the account on a = national level and now 800 ship to locations....

send/receive (2nd try)
New computer. Microsoft XP Home. Microsoft Office XP Small Business 2002. Earthlink dial-up account. Two e- mail accounts. After opening Outlook, 1st send/receive (option 3, all accounts) usually prompts for both passwords, downloads messages, all good. Next time, though, no prompt for account 2, error cannot connect to server, account 1 usually gets messages. Every five minute send/receive option eventually degenerates to cannot connect to server errors for both accounts. Meanwhile internet browsing slows to a crawl. Any ideas? ...

Value Based Colorization of Dialog Controls
I'm currently working with an MFC dialog box that displays numerical data dynamically from a remote server in a series of text control boxes. I'd like to be able to change the background color of these boxes based upon the values in the boxes. So far, I've been able to change the default color of the background of the entire dialog box and modify all text colors. However, modifying colors for specific boxes and making changes based on values called from those boxes is a bit challenging for me. If anyone could give me any tips or ideas on how I might approach this, I would be very ...

secondary category axis reset to min=0 max=0 on save
I have a combination stacked column, line, XY chart with all of the stacked columns and a line on the primary axis, and another line and XY plotted against the secondary (X & Y) axis. The secondary category (x) axis is a time-scale manually set to 1/1/2006 - 2/29/2008, with a base unit of 1 day. The chart is great except that when I try to save (or close & save) it, the secondary x axis is reset to min=0 & max=0, so everything plotted against the secondary axis effectively disappears. I can reopen the chart and set the secondary x axis to the appropriate date range and ev...

How do I cancel a msg Outlook keeps trying to send unsuccessfully?
How do I cancel an "in process" email Outlook keeps trying to send unsuccessfully due to a huge email message I tried to send with way too many attachments? It's stuck in "send" mode, and as a result, I can't send any emails because Outlook cannot get past trying to send this message. How do I cancel a pending outbox transmission while it's trying to send? I've tried everything I can think of to no avail. Please help! Angelczech wrote on Fri, 12 March 2010 07:32 > How do I cancel an "in process" email Outlook keeps trying to send ...

how do I accrue balances based on the actual date?
I am trying to have a database that will automatically be able to keep the balance of sick time available, based on the actual date. The sick time is accrued on a monthly basis, I would like the formula to show after the date has already past. ...

Calendar Appointments
When sending an appointment to a selected user, everyone is sent the appointment and requested to respond on behalf of that person - thereby confusing users that were not invited directly to such an appointment. Can you assist? First, I'd check the user's settings to see whether he/she has inadvertently set up everyone as a delegate. (Tools > Options > Delegates) If it's appropriate (for some reason) for everyone to be a delegate of this user, then make sure the checkbox to send each delegate copies of all meeting-related messages is UNchecked. Tammy >-----Or...

Que Assignments
Sql Server 2000 I have a table called tblAccountNumRecords that contains an integer field called "MREmployeeID". This table contains (Variable) 20,000 records each day and is purged at the end of the day. I have a table called tblEmployees with a integer field called EmpID and a text field called "WorkQue". Each employee is assigned a Work Que Employee 1 has "Work Que 1" assigned to them. Employee 2 has "Work Que 2" assigned to them. Employee 2 has "Work Que 3" assigned to them. 10,000 of the 20,000 reco...

trying to insert a 0 in front of zipcode
Hello, I do not use excel at all so i have no clue! I have a list of daycares that i want to create mailing labels with...about 700 of them but the problem is my zipcode column there needs to be a zero in front of all 700 zipcodes how to i insert a zero in front of them without having to type it into each box? the other question is can i print labels directly from excel or do i have to go thru ms word? thanks Greg One of these 1) format the cells with custom format 00000 2) format the cells with Special / Zip Codes 3) format the cells as Text 4) begin all zip codes with an sin...

Sort WBS Codes
I have WBS codes exported from project, how do I sort so that eg 1.8.3 comes before 1.8.10. Obviously text sorting will put the 1.8.10 first. If you add some columns after the column with the WBS codes, you ca select the WBS column and do a Text To Columns funtion from the dat menu. Choose delimited and select a period as the delimitor. The sort by the new columns. You can then delete these columns. You may want to copy the WBS column first so you don't have to paste i back together after the sort. -- Message posted from http://www.ExcelForum.com Hi John you may apply the proce...

Display Time based on another field value
Im trying to insert the current time in a field based on another fields value which has 3 different values from a list box the value in this field is text. How do I go about write the formula? SFCNS Shaun Are you working in MS Access, the relational database? Are you trying to do this in a form (good) or directly in a table (bad)? Are you saying the "other" field has multiple values or just one? More info, please... -- Regards Jeff Boyce Microsoft Access MVP Disclaimer: This author may have received products and services mentioned in this post. Menti...

error message when trying to install WMP 10 or 11
My operating system is Windows XP Home Edition 2002. I'm trying to download either WMP 10 or 11 and I get a message saying it was not possible to complete setup, see webhelp for more assistance, however there is no additional information when I click Web help. the Error message is 8007F0DA. Can anyone help me? Thanks. On Tue, 30 Mar 2010 07:54:01 -0700, Nate <Nate@discussions.microsoft.com> wrote: > >My operating system is Windows XP Home Edition 2002. I'm trying to download >either WMP 10 or 11 and I get a message saying it was not possible to &g...

Printers Assign to Departments
Dear All, I would like to connect printers as much as departments i have & assign printers to deparments, the reciept goes automatically to the printer which is assigned to department that contain the selected items. Any assist will be appreciated. Thanks in Advance, Ibrahim Zubair hi Zubair, The such facility is not available in RMS only up to 2 printers per register you can assigned, however you may create your on add-on and do hook at the time of trnasaction to print on specified department printer. Let me tell you its not as easy you may think. Akber "Ibrahim Zubair&...

How do I assign the value in a cell to a variable?
I'm sure this is easy for someone, TIA. I need a macro to search a range of cells (I can do that) and find a cell with a value (which can change) verses other cells that have no value. I can make the macro select the cell and copy it, but i need to assign the value the macro finds in that cell to a variable. Does the copied value in the clipboard have a name? Thanks again, Jason You can create a variable in VBA and assign it the value of the cell using the activeccell.value property You can assign value when you track the cell with value Your code could be dim x 'declare a variabl...