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 » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Add-in not reading message



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 21st 08, 11:33 PM posted to microsoft.public.outlook.program_addins
Peg
external usenet poster
 
Posts: 8
Default Add-in not reading message

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
Ads
  #2  
Old July 22nd 08, 02:25 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Add-in not reading message

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" wrote in message
...
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


  #3  
Old July 22nd 08, 03:25 PM posted to microsoft.public.outlook.program_addins
Peg
external usenet poster
 
Posts: 8
Default Add-in not reading message

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" wrote in message
...
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



  #4  
Old July 22nd 08, 09:14 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Add-in not reading message

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" wrote in message
...
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


  #5  
Old July 22nd 08, 09:36 PM posted to microsoft.public.outlook.program_addins
Peg
external usenet poster
 
Posts: 8
Default Add-in not reading message

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" wrote in message
...
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



  #6  
Old July 23rd 08, 02:47 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Add-in not reading message

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" wrote in message
...
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


 




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
This message with restricted permission cannot be viewed reading bluemusicnut Outlook - Calandaring 0 July 14th 08 11:53 AM
Reading messages and deleting them and moving to the next message Snapper[_3_] Outlook - General Queries 1 May 17th 08 03:43 PM
Outlook Reading Message problems ITCOM Outlook - General Queries 0 March 2nd 07 10:11 AM
Modify the message form for reading in OL2007 lee Outlook - Using Forms 2 July 29th 06 06:01 AM
Prevent surrogate from reading a private message? KEB Outlook - Using Contacts 1 July 27th 06 06:23 PM


All times are GMT +1. The time now is 08:27 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.