VSTO Outlook add-in: Categories not displaying correctly

Status
Not open for further replies.
T

TTT

An Outlook add-in is not working correctly on a client site.

The add-in should change the Categories of an Inbox email. We want the Categories to change to "Reg'd" when the user registers an Inbox email to our database via the add-in.

On a particular clients machine, this will work OK if the email has been opened, but will not make any change to the Categories if the email hasn't been opened, just selected and right clicked to access the add-in menu. In all cases, the email has been properly sent to the database. I am pretty sure the line of code to update Categories is being called in all instances.

I can't reproduce this error to debug on my machine, where Categories updates correctly in all cases.

All machines are on 2003 SP 3. The client is operating outlook via terminal services. Could this cause problems?

What can cause the Categories column to not update correctly in cases like this?.
 
K

Ken Slovak - [MVP - Outlook]

It's certainly possible that terminal services has something to do with it,

but I don't see how. If your code is modifying specific items the category

is being added as a one-off on the items. So it shouldn't matter if the

category is in the master list as a custom category or not (those are stored

in the registry for Outlook 2003).

That it works when the change is made to an Inspector but not in an Explorer

context menu would also tend to indicate that TS has nothing to do with it,

the end result would be the same in either case.

I would add additional logging to see if the code is actually hit and does

run without exceptions. I'd also see what's different on that user's machine

than on others where the code runs. Addins and any other code that

interfaces with Outlook should be checked and disabled to see if they have

any effect.

"TTT" <alistair[at]timetracer[dot]com[dot]au> wrote in message

news:uTX4iBg1KHA.264@TK2MSFTNGP05.phx.gbl...
> An Outlook add-in is not working correctly on a client site. The add-in
> should change the Categories of an Inbox email. We want the Categories to
> change to "Reg'd" when the user registers an Inbox email to our database
> via the add-in.
> On a particular clients machine, this will work OK if the email has been
> opened, but will not make any change to the Categories if the email hasn't
> been opened, just selected and right clicked to access the add-in menu. In
> all cases, the email has been properly sent to the database. I am pretty
> sure the line of code to update Categories is being called in all
> instances.

> I can't reproduce this error to debug on my machine, where Categories
> updates correctly in all cases.
> All machines are on 2003 SP 3. The client is operating outlook via
> terminal services. Could this cause problems?

> What can cause the Categories column to not update correctly in cases like
> this?.
 
T

TTT

I have found a related problem that I can reproduce. I think if I can fix this it may fix the original problem.

When I select multiple emails and register them to our database, only the first one selected has its Category changed to Reg'd. The others' behaviour depends on what mail server I am running. If I am on a POP account, the Category does not change. On a Microsoft Exchange Server at first the "Reg'd" doesn't show, but if I click on the email and then off, it appears.

The code is effectively like this, with my logging added to double check that the correct string is going in.

foreach (Outlook.MailItem mailItem in _emails)

{

mailItem.Save();

// Add the registered category to the mail item

CategoryHelper.AddCategory(mailItem, EmailManager.RegCategory);

MessageBox.Show(mailItem.Categories);

//We have to save the email if the properties are to stay.

mailItem.Save();

MessageBox.Show(mailItem.Categories);

}

If I run this with two emails selected the following happens

MessageBox Reg'd

The first email Category changes to Reg'd

MessageBox Reg'd

MessageBox Reg'd

No change in second email

MessageBox Reg'd

So the Save works for the first email, but not the second.

Any explanations?


> kenslovak wrote on Wed, 07 April 2010 09:22
> It's certainly possible that terminal services has something to do with it,
> but I don't see how. .
 
K

Ken Slovak - [MVP - Outlook]

I have no explanation for that and I've never seen anything like that

happen. Offhand the code looks OK but I have no idea what that helper is

doing or if it might cause an exception that might prevent adding a

category.

"TTT" <alistair[at]timetracer[dot]com[dot]au> wrote in message

news:uu0ixg71KHA.5880@TK2MSFTNGP05.phx.gbl...
> I have found a related problem that I can reproduce. I think if I can fix
> this it may fix the original problem.

> When I select multiple emails and register them to our database, only the
> first one selected has its Category changed to Reg'd. The others'
> behaviour depends on what mail server I am running. If I am on a POP
> account, the Category does not change. On a Microsoft Exchange Server at
> first the "Reg'd" doesn't show, but if I click on the email and then off,
> it appears.

> The code is effectively like this, with my logging added to double check
> that the correct string is going in.

> foreach (Outlook.MailItem mailItem in _emails)
> {

> mailItem.Save();

> // Add the registered category to the mail item
> CategoryHelper.AddCategory(mailItem,
> EmailManager.RegCategory);

> MessageBox.Show(mailItem.Categories);

> //We have to save the email if the properties are
> to stay.
> mailItem.Save();

> MessageBox.Show(mailItem.Categories);
> }

> If I run this with two emails selected the following happens

> MessageBox Reg'd
> The first email Category changes to Reg'd
> MessageBox Reg'd
> MessageBox Reg'd
> No change in second email
> MessageBox Reg'd

> So the Save works for the first email, but not the second.

> Any explanations?
>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
A Not able to load an add-in for outlook 2007 developed in VSTO 2005 Outlook VBA and Custom Forms 2
O VSTO - Outlook Add-In - Get GAL data Outlook VBA and Custom Forms 1
K Outlook VSTO Add-in not visible in Trust Center after installing Outlook VBA and Custom Forms 1
M Will a VSTO C# Outlook 2007 Add-in work on Outlook 2010? Outlook VBA and Custom Forms 1
M c# vsto Outlook.ApplicationEvents_11_NewMailEx Outlook VBA and Custom Forms 1
X Highlight block of text in an outlook mail using c#2008 vsto Outlook VBA and Custom Forms 1
W My VSTO 3.0 Outlook addin doesn’t load Outlook VBA and Custom Forms 1
N VSTO outlook 2007 addin installation problem Outlook VBA and Custom Forms 1
O Third-party VSTO 2005 SE plug-in for Outlook 2007: what should I signwith a publisher certificate? Outlook VBA and Custom Forms 3
O Outlook VSTO 2005 plug-in installer: CLSID = ? Outlook VBA and Custom Forms 3
E Opening WinForm in Outlook 2003 VSTO Addin with Wordmail enabled Outlook VBA and Custom Forms 1
M Develop for OL2003 on OL2007 machine using VS2008 and VSTO? Outlook VBA and Custom Forms 1
E VSTO 2008 how to bind Form Region controls to Item data fields Outlook VBA and Custom Forms 2
E VSTO 2008 how to bind Form Region controls to Item data fields Outlook VBA and Custom Forms 3
M VSTO deployment? Outlook VBA and Custom Forms 1
M VSTO C#: How do I declare an application scope variable? Outlook VBA and Custom Forms 2
S VSTO calling unmanged function Outlook VBA and Custom Forms 3
G Interop or VSTO or ? Outlook VBA and Custom Forms 2
M VSTO 2007 Addin auto-disabled on one machine but not another on installation? Outlook VBA and Custom Forms 1
O using VSTO to get Available Mailboxes Outlook VBA and Custom Forms 11
M Outlook2007 and VSTO, handle the Click on the Save Button in the IPM.Note dialog HOWTO? Outlook VBA and Custom Forms 4
M VSTO Outlook2007 Addin. After switching from 3.5 to 2.0 Framework i get "'MSB3185: EntryPoint not sp Outlook VBA and Custom Forms 1
C Problem installing VSTO AddIn on Vista Outlook VBA and Custom Forms 3
Retired Geek Outlook for the MAC with Yahoo accounts now very broken Using Outlook 6
S Outlook 2002- "Send" button has disappeared. Help please. Using Outlook 1
L How Stop Outlook Nag Messages Using Outlook 1
TomHuckstep Remove Send/Receive All Folders (IMAP/POP) button from Outlook 365 Ribbon Using Outlook 1
L I Cannot Sign Into My Outlook Account? Outlook VBA and Custom Forms 0
icacream Outlook 2021 - Google calendar in the peek Using Outlook 0
e_a_g_l_e_p_i Question about installing my Gmail account on my iPhone but still getting messages downloaded to my desktop Outlook. Using Outlook 3
F Want to add second email to Outlook for business use Using Outlook 5
kburrows Outlook Email Body Text Disappears/Overlaps, Folders Switch Around when You Hover, Excel Opens Randomly and Runs in the Background - Profile Corrupt? Using Outlook 0
M using excel to sort outlook appointment items Outlook VBA and Custom Forms 4
e_a_g_l_e_p_i MY Outlook 2021 changed the format of the shortcuts for mail, calendar etc. Using Outlook 10
Z Outlook 2021 Outlook new emails notification not working Using Outlook 5
K Changing the Deleted Items location in Outlook 2019 Using Outlook 2
J Outlook 365 Outlook Macro to Sort emails by column "Received" to view the latest email received Outlook VBA and Custom Forms 0
V How to use Comas in a picklist in Outlook forms Outlook VBA and Custom Forms 3
e_a_g_l_e_p_i Question about reinstalling Outlook 2021 Using Outlook 5
A Outlook 365 Outlook (part of 365) now working offline - argh Using Outlook 5
M Outlook Macro to save as Email with a file name format : Date_Timestamp_Sender initial_Email subject Outlook VBA and Custom Forms 0
G LinkedIn tab missing in Outlook 365 (but working in OWA) Using Outlook 0
Jay Freedman Outlook forgets "not junk" marking Using Outlook 0
KurtLass Opening Graphics Attachments in Outlook 2021 Using Outlook 0
P now on office 365 but getting error messages about missing Outlook 2013 cache folders Using Outlook 2
B Outlook config download Outlook VBA and Custom Forms 1
M Short term workaround for when Outlook searching stopped functioning Using Outlook 0
D Outlook 2016 Creating an outlook Macro to select and approve Outlook VBA and Custom Forms 0
L Fetch, edit and forward an email with VBA outlook Outlook VBA and Custom Forms 2
BartH VBA no longer working in Outlook Outlook VBA and Custom Forms 1

Similar threads

Top