473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

mscorlib object reference not set to an instance of an object

Hi i m getting error "mscorlib object reference not set to an instance of an object" in my programming when i am trying to retrieve the sender name or recipient name from folders in MAPI with exchange server.

Here is the code:
Expand|Select|Wrap|Line Numbers
  1. Public Sub Read_TasksRequest(ByVal oMsgColl As MAPI.Messages)
  2.         ' Dim oMsgColl As MAPI.Messages
  3.         Dim oMsgFilter As MAPI.MessageFilter
  4.         Console.WriteLine("-----------------------------")
  5.         Console.WriteLine("Tasks Request")
  6.         Console.WriteLine("----------------------------")
  7.         ' oMsgColl = ObjFolder.Messages
  8.         oMsgFilter = oMsgColl.Filter
  9.         oMsgFilter.Type = TaskRequestType
  10.         Dim iTsks As MAPI.Message
  11.         iTsks = oMsgColl.GetFirst
  12.         Do While (Not iTsks Is Nothing)
  13.             'If iTsks.Unread = True Then
  14.             '    Console.WriteLine("Message is read")
  15.             'Else
  16.             '    Console.WriteLine("Message is unread")
  17.             'End If
  18.             Console.WriteLine(iTsks.Text)
  19.             Console.WriteLine(iTsks.Subject)
  20.             Console.WriteLine(iTsks.ID)
  21.             Dim sender1 As Object
  22.             If iTsks.Sent = True Then
  23.                 sender1 = iTsks.Sender
  24.                 Dim strSender As String = sender1.Name
  25.                 If Not strSender = "" Then
  26.                     Console.WriteLine(strSender)
  27.                 End If
  28.                 'display_sender(sender)
  29.             End If
  30.             sender1 = Nothing
  31.             'End If
  32.             iTsks = oMsgColl.GetNext
  33.         Loop
  34.         oMsgColl = Nothing
  35.         oMsgFilter = Nothing
  36.         iTsks = Nothing
  37.         Console.WriteLine("-----------------------------")
  38.         Console.WriteLine("End Task Request")
  39.         Console.WriteLine("----------------------------")
  40.  
  41.     End Sub
  42.  
Mar 6 '09 #1
1 2730
tlhintoq
3,525 Expert 2GB
Where did Visual Studio stop? What line did it break on?
Mar 6 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

28
by: Daniel | last post by:
Hello =) I have an object which contains a method that should execute every x ms. I can use setInterval inside the object construct like this - self.setInterval('ObjectName.methodName()',...
1
by: Elliot M. Rodriguez | last post by:
A few of our customers cannot access one of the pages on our vb.net asp.net site. The problems are limited to only a few people, but these people have the problem regularly. The page in question...
3
by: Adam | last post by:
We have a web site that uses .vb for the web pages and .cs for a class module. We are getting the error in .NET 2.0 and VS 2005 beta 2. It does work with .NET 1.1. When trying to access a page...
4
by: Earl | last post by:
Created a .dll to use in multiple projects. Very simple, one class to return a purpose for a particular version. But when I added it as a reference to one of my other projects, I get a build error...
5
by: ramakrishnads | last post by:
Hi, I need an urgent help. I am developing a windows application in vb.net, using arcobjects. I am getting an error when i am exiting the application. I am using "End" to exit the application,...
12
by: Andrew Poulos | last post by:
With the following code I can't understand why this.num keeps incrementing each time I create a new instance of Foo. For each instance I'm expecting this.num to alert as 1 but keeps incrementing. ...
6
by: Shailen Sukul | last post by:
Observed a weird behaviour with object references. See code listing below: using System; using System.Collections.Generic; using System.Text; namespace PointerExceptionTest { /*
2
by: Ralph | last post by:
Hi I don't understand why it's not working: function schedule(imTop){ this.tdImagesTop = imTop; } schedule.prototype.selectEl = function() { alert(this.tdImagesTop);
0
by: paulodonnell99 | last post by:
Hi, I am trying to build an installer application to run on the compact framework, I want to produce a netmodule using CSC.exe, then use AL.exe to embed resouce files and produce an exe. My...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.