PC Review


Reply
Thread Tools Rate Thread

Add-in not reading message

 
 
Peg
Guest
Posts: n/a
 
      22nd Jul 2008
I developed an addin for Outlook 2003 using c#. Everything was working fine
until our company outsourced Exchange. When I tried to read a message body, I
got either a blank or error.

I have a work-around in place where I display the mail in the inspector
window, read the text and then close the window. This works, but takes longer
and has a flash of the open window for the user to see. This also changes the
'read' status of the email to read and I cannot change it to unread.

Any thoughts on another solution?
--
Peg
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      22nd Jul 2008
That sounds very odd. Are you still using mailboxes? Using cached mode?

What's your code for reading an item in an Explorer?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Peg" <(E-Mail Removed)> wrote in message
news:35BC22FC-5ABE-4C76-B796-(E-Mail Removed)...
>I developed an addin for Outlook 2003 using c#. Everything was working fine
> until our company outsourced Exchange. When I tried to read a message
> body, I
> got either a blank or error.
>
> I have a work-around in place where I display the mail in the inspector
> window, read the text and then close the window. This works, but takes
> longer
> and has a flash of the open window for the user to see. This also changes
> the
> 'read' status of the email to read and I cannot change it to unread.
>
> Any thoughts on another solution?
> --
> Peg
>


 
Reply With Quote
 
Peg
Guest
Posts: n/a
 
      22nd Jul 2008
We are still using mailboxes. Most of our users have pst files but some keep
their mail on the server and use cached exchange mode.

here is my code for obtaining the message:
....
Outlook.MailItem mi = obj as Outlook.MailItem;
....
mi.Display(false);
....
sNewComments = mi.Body;
....
mi.Close(OlInspectorClose.olSave)
....

There is a lot more of course, so if you need it I do not think you want it
posted in this forum
--
Peg


"Ken Slovak - [MVP - Outlook]" wrote:

> That sounds very odd. Are you still using mailboxes? Using cached mode?
>
> What's your code for reading an item in an Explorer?
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "Peg" <(E-Mail Removed)> wrote in message
> news:35BC22FC-5ABE-4C76-B796-(E-Mail Removed)...
> >I developed an addin for Outlook 2003 using c#. Everything was working fine
> > until our company outsourced Exchange. When I tried to read a message
> > body, I
> > got either a blank or error.
> >
> > I have a work-around in place where I display the mail in the inspector
> > window, read the text and then close the window. This works, but takes
> > longer
> > and has a flash of the open window for the user to see. This also changes
> > the
> > 'read' status of the email to read and I cannot change it to unread.
> >
> > Any thoughts on another solution?
> > --
> > Peg
> >

>
>

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      22nd Jul 2008
The code you show doesn't look like a problem.

Is the mail item displaying?

If it does display does it show the body in the UI?

Do you get Body if you wait a while after opening the item before you read
body?

What about using similar code in the Outlook VBA project, does that work?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Peg" <(E-Mail Removed)> wrote in message
news:7D527C6F-2DD6-454E-9DC3-(E-Mail Removed)...
> We are still using mailboxes. Most of our users have pst files but some
> keep
> their mail on the server and use cached exchange mode.
>
> here is my code for obtaining the message:
> ...
> Outlook.MailItem mi = obj as Outlook.MailItem;
> ...
> mi.Display(false);
> ...
> sNewComments = mi.Body;
> ...
> mi.Close(OlInspectorClose.olSave)
> ...
>
> There is a lot more of course, so if you need it I do not think you want
> it
> posted in this forum
> --
> Peg


 
Reply With Quote
 
Peg
Guest
Posts: n/a
 
      22nd Jul 2008
I did not used to have to call display -- I only needed to do that when we
outsourced. At that time we also went from Exchange 2000 here to Exchange
2003 at the outsourcer's site. We also went from using VB6 (not VBA) to .Net
and C# to address the security issues.

So the mail item is displaying and the mail is getting marked as read. I was
hoping not to use similar code but to go back to getting the body without
displaying the UI. I also want to be able to update and distribute that
update and VBA is not a good option for that.

I do not know if this helps, but I get all of the header with no problem, so
I only need to display the ones that need to be saved in our database.
--
Peg


"Ken Slovak - [MVP - Outlook]" wrote:

> The code you show doesn't look like a problem.
>
> Is the mail item displaying?
>
> If it does display does it show the body in the UI?
>
> Do you get Body if you wait a while after opening the item before you read
> body?
>
> What about using similar code in the Outlook VBA project, does that work?
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Professional Programming Outlook 2007.
> Reminder Manager, Extended Reminders, Attachment Options.
> http://www.slovaktech.com/products.htm
>
>
> "Peg" <(E-Mail Removed)> wrote in message
> news:7D527C6F-2DD6-454E-9DC3-(E-Mail Removed)...
> > We are still using mailboxes. Most of our users have pst files but some
> > keep
> > their mail on the server and use cached exchange mode.
> >
> > here is my code for obtaining the message:
> > ...
> > Outlook.MailItem mi = obj as Outlook.MailItem;
> > ...
> > mi.Display(false);
> > ...
> > sNewComments = mi.Body;
> > ...
> > mi.Close(OlInspectorClose.olSave)
> > ...
> >
> > There is a lot more of course, so if you need it I do not think you want
> > it
> > posted in this forum
> > --
> > Peg

>
>

 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      23rd Jul 2008
I suggested using VBA as a test, not for your code deployment. I'd suggest
seeing if you still have the same problem without displaying the item using
equivalent VBA code, which would tend to suggest a timing problem.

..NET code is slower than VB6 code to startup (JIT compilation, starting the
CLR) and to run since everything is effectively late bound and has to pass
through the Interop before your code even gets to work on things. So some
timing issues you might never see in unmanaged code might appear in managed
code. Thus my suggestion about seeing if delaying reading the body might
help.

Another thing you might try, depending on your Outlook version which you
don't mention, is to look at the DownloadState property of the item before
attempting to read the Body. Make sure that's OlDownloadState.olFullItem.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Peg" <(E-Mail Removed)> wrote in message
news:E08B67DF-F539-4B0A-9C2C-(E-Mail Removed)...
>I did not used to have to call display -- I only needed to do that when we
> outsourced. At that time we also went from Exchange 2000 here to Exchange
> 2003 at the outsourcer's site. We also went from using VB6 (not VBA) to
> .Net
> and C# to address the security issues.
>
> So the mail item is displaying and the mail is getting marked as read. I
> was
> hoping not to use similar code but to go back to getting the body without
> displaying the UI. I also want to be able to update and distribute that
> update and VBA is not a good option for that.
>
> I do not know if this helps, but I get all of the header with no problem,
> so
> I only need to display the ones that need to be saved in our database.
> --
> Peg


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Message Reading pane is Gray, message window transparent: Outlook 2003 John Polcari Microsoft Outlook Discussion 2 11th Sep 2008 05:16 PM
purge message reading "message no longer availble on server" =?Utf-8?B?Q2hyaXM=?= Microsoft Outlook Discussion 0 1st Nov 2006 12:21 AM
Problem reading message from MS message queuing sam Microsoft C# .NET 0 20th Oct 2005 09:27 AM
Re: Thank-you for reading my message jim dorey Computer Hardware 0 2nd Aug 2005 11:10 AM
Change Encoding when Reading a message, viewing picture inside the message iivuch Microsoft Outlook 1 6th Jan 2004 05:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:02 PM.