473,396 Members | 1,998 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,396 software developers and data experts.

Slow opening of outlook

Hi

When I open a new outlook email from vb.net, sometimes outlook is very slow
to appear or occasionally outlook freezes completely. I am targeting mixed
office2000/xp environments so I am using the office2000 interop dlls
generated by vs.net by adding office 2000 com reference.

Any one else noticed this problem when targeting office2000/xp mixed
environments? Is there a better, more robust way to do this? Am I better off
using late binding?

Thanks

Regards


Nov 20 '05 #1
10 2809
Do you have MS Messenger running ?

"John" <jo**@nospam.infovis.co.uk> wrote in message
news:#M**************@tk2msftngp13.phx.gbl...
Hi

When I open a new outlook email from vb.net, sometimes outlook is very slow to appear or occasionally outlook freezes completely. I am targeting mixed
office2000/xp environments so I am using the office2000 interop dlls
generated by vs.net by adding office 2000 com reference.

Any one else noticed this problem when targeting office2000/xp mixed
environments? Is there a better, more robust way to do this? Am I better off using late binding?

Thanks

Regards

Nov 20 '05 #2
Nope.

Regards

"Marcel" <so*********@spam.com> wrote in message
news:e8*************@tk2msftngp13.phx.gbl...
Do you have MS Messenger running ?

"John" <jo**@nospam.infovis.co.uk> wrote in message
news:#M**************@tk2msftngp13.phx.gbl...
Hi

When I open a new outlook email from vb.net, sometimes outlook is very

slow
to appear or occasionally outlook freezes completely. I am targeting mixed office2000/xp environments so I am using the office2000 interop dlls
generated by vs.net by adding office 2000 com reference.

Any one else noticed this problem when targeting office2000/xp mixed
environments? Is there a better, more robust way to do this? Am I better

off
using late binding?

Thanks

Regards


Nov 20 '05 #3
John,
Are you starting Outlook fresh or is it already running? When Outlook is
already running does the same thing happen?

Does this happen "right away" or after using Outlook from VB.NET for awhile?

Are you using System.Runtime.InteropServices.Marshal.ReelaseComO bject on
each Outlook object returned, when you are done with that object?

Are you calling Item.Display to show an item or just connecting and
retrieving & updating information? Does this "slowness" happen with specific
Outlook objects & methods?

Do you have other things running on your computer?

Which version of the OS?

Are you using Exchange Server or internet mode?

Are you getting the "security dialog" that states that someone is accessing
your email? And just not seeing it in time?
In case you don't have it, the following site provides a plethora of
articles on using Outlook from .NET:
http://www.microeye.com/resources/res_outlookvsnet.htm

Using Outlook 2003 with VB.NET & the Office 2003 PIA I have not noticed
Outlook being slow to appear.

Unfortunately I don't have a machine with either office 2000 or Office XP.

Hope this helps
Jay

"John" <jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi

When I open a new outlook email from vb.net, sometimes outlook is very slow to appear or occasionally outlook freezes completely. I am targeting mixed
office2000/xp environments so I am using the office2000 interop dlls
generated by vs.net by adding office 2000 com reference.

Any one else noticed this problem when targeting office2000/xp mixed
environments? Is there a better, more robust way to do this? Am I better off using late binding?

Thanks

Regards

Nov 20 '05 #4
I am using display to allow user to enter the email and then press send
button to send it. I am not using
System.Runtime.InteropServices.Marshal.ReelaseComO bject. Is there an example
I can see on how to use it?

Thanks

Regards

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:OP**************@tk2msftngp13.phx.gbl...
John,
Are you starting Outlook fresh or is it already running? When Outlook is
already running does the same thing happen?

Does this happen "right away" or after using Outlook from VB.NET for awhile?
Are you using System.Runtime.InteropServices.Marshal.ReelaseComO bject on
each Outlook object returned, when you are done with that object?

Are you calling Item.Display to show an item or just connecting and
retrieving & updating information? Does this "slowness" happen with specific Outlook objects & methods?

Do you have other things running on your computer?

Which version of the OS?

Are you using Exchange Server or internet mode?

Are you getting the "security dialog" that states that someone is accessing your email? And just not seeing it in time?
In case you don't have it, the following site provides a plethora of
articles on using Outlook from .NET:
http://www.microeye.com/resources/res_outlookvsnet.htm

Using Outlook 2003 with VB.NET & the Office 2003 PIA I have not noticed
Outlook being slow to appear.

Unfortunately I don't have a machine with either office 2000 or Office XP.

Hope this helps
Jay

"John" <jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi

When I open a new outlook email from vb.net, sometimes outlook is very

slow
to appear or occasionally outlook freezes completely. I am targeting mixed office2000/xp environments so I am using the office2000 interop dlls
generated by vs.net by adding office 2000 com reference.

Any one else noticed this problem when targeting office2000/xp mixed
environments? Is there a better, more robust way to do this? Am I better

off
using late binding?

Thanks

Regards


Nov 20 '05 #5
John,
Did you try searching MSDN for ReleaseComObject?

The first link returned looks like a promising example:

http://msdn.microsoft.com/library/de...omateVBNet.asp

The second link is the documentation for the function:

http://msdn.microsoft.com/library/de...bjecttopic.asp

Hope this helps
Jay
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
I am using display to allow user to enter the email and then press send
button to send it. I am not using
System.Runtime.InteropServices.Marshal.ReelaseComO bject. Is there an example I can see on how to use it?

Thanks

Regards

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:OP**************@tk2msftngp13.phx.gbl...
John,
Are you starting Outlook fresh or is it already running? When Outlook is
already running does the same thing happen?

Does this happen "right away" or after using Outlook from VB.NET for

awhile?

Are you using System.Runtime.InteropServices.Marshal.ReelaseComO bject on
each Outlook object returned, when you are done with that object?

Are you calling Item.Display to show an item or just connecting and
retrieving & updating information? Does this "slowness" happen with

specific
Outlook objects & methods?

Do you have other things running on your computer?

Which version of the OS?

Are you using Exchange Server or internet mode?

Are you getting the "security dialog" that states that someone is

accessing
your email? And just not seeing it in time?
In case you don't have it, the following site provides a plethora of
articles on using Outlook from .NET:
http://www.microeye.com/resources/res_outlookvsnet.htm

Using Outlook 2003 with VB.NET & the Office 2003 PIA I have not noticed
Outlook being slow to appear.

Unfortunately I don't have a machine with either office 2000 or Office XP.

Hope this helps
Jay

"John" <jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi

When I open a new outlook email from vb.net, sometimes outlook is
very slow
to appear or occasionally outlook freezes completely. I am targeting mixed office2000/xp environments so I am using the office2000 interop dlls
generated by vs.net by adding office 2000 com reference.

Any one else noticed this problem when targeting office2000/xp mixed
environments? Is there a better, more robust way to do this? Am I

better off
using late binding?

Thanks

Regards



Nov 20 '05 #6
Hi

Not sure how to relate the access example with outlook. Tried to mimic it
but no luck and same error. Isn't there an outlook example around, creating
a new email then display and then cleanup?

Regards

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
John,
Did you try searching MSDN for ReleaseComObject?

The first link returned looks like a promising example:

http://msdn.microsoft.com/library/de...omateVBNet.asp
The second link is the documentation for the function:

http://msdn.microsoft.com/library/de...bjecttopic.asp
Hope this helps
Jay
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
I am using display to allow user to enter the email and then press send
button to send it. I am not using
System.Runtime.InteropServices.Marshal.ReelaseComO bject. Is there an

example
I can see on how to use it?

Thanks

Regards

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:OP**************@tk2msftngp13.phx.gbl...
John,
Are you starting Outlook fresh or is it already running? When Outlook is already running does the same thing happen?

Does this happen "right away" or after using Outlook from VB.NET for

awhile?

Are you using System.Runtime.InteropServices.Marshal.ReelaseComO bject on each Outlook object returned, when you are done with that object?

Are you calling Item.Display to show an item or just connecting and
retrieving & updating information? Does this "slowness" happen with

specific
Outlook objects & methods?

Do you have other things running on your computer?

Which version of the OS?

Are you using Exchange Server or internet mode?

Are you getting the "security dialog" that states that someone is

accessing
your email? And just not seeing it in time?
In case you don't have it, the following site provides a plethora of
articles on using Outlook from .NET:
http://www.microeye.com/resources/res_outlookvsnet.htm

Using Outlook 2003 with VB.NET & the Office 2003 PIA I have not noticed Outlook being slow to appear.

Unfortunately I don't have a machine with either office 2000 or Office

XP.
Hope this helps
Jay

"John" <jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> Hi
>
> When I open a new outlook email from vb.net, sometimes outlook is very slow
> to appear or occasionally outlook freezes completely. I am targeting

mixed
> office2000/xp environments so I am using the office2000 interop dlls
> generated by vs.net by adding office 2000 com reference.
>
> Any one else noticed this problem when targeting office2000/xp mixed
> environments? Is there a better, more robust way to do this? Am I better off
> using late binding?
>
> Thanks
>
> Regards
>
>
>
>



Nov 20 '05 #7
John,
How does that saying go: Give a man a fish he eats for a day, teach a man to
fix he eats for live? :-)

The Access example should show you enough of the Concept of working with
Office Automation & ReleaseComObject when combined with the Outlook VBA Help
you should be able to create a working example! As I find VB6 & VBA examples
come are translated almost 1 for 1, the few exceptions to the rule I find
are easy to remember.
but no luck and same error. Isn't there an outlook example around, creating a new email then display and then cleanup? Unfortunately I am not setup to test Outlook 2000 automation with .NET.
However! others have used Outlook 2000 from VB.NET with success, have you
reviewed the info at:

http://www.microeye.com/resources/res_outlookvsnet.htm

There is at least one article that specifically deals specifically with
Outlook 2000!

Here is an example of "creating a new email, then display, and then
cleanup":

Imports System.Runtime.InteropServices
Dim app As New Outlook.Application
Dim ns As Outlook.NameSpace
ns = app.GetNamespace("MAPI")
ns.Logon()
Dim mailItem As Outlook.MailItem
mailItem = DirectCast(app.CreateItem(Outlook.OlItemType.olMai lItem),
Outlook.MailItem)
mailItem.Display(False)

Marshal.ReleaseComObject(mailItem)
ns.Logoff()
Marshal.ReleaseComObject(ns)
Marshal.ReleaseComObject(app)
Return

I am checking with my fellow Outlook MVPs on why mailItem.Display(True)
leaves the window on the screen.

Hope this helps
Jay
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... Hi

Not sure how to relate the access example with outlook. Tried to mimic it
but no luck and same error. Isn't there an outlook example around, creating a new email then display and then cleanup?

Regards

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
John,
Did you try searching MSDN for ReleaseComObject?

The first link returned looks like a promising example:

http://msdn.microsoft.com/library/de...omateVBNet.asp

The second link is the documentation for the function:

http://msdn.microsoft.com/library/de...bjecttopic.asp

Hope this helps
Jay
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
I am using display to allow user to enter the email and then press send button to send it. I am not using
System.Runtime.InteropServices.Marshal.ReelaseComO bject. Is there an

example
I can see on how to use it?

Thanks

Regards

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:OP**************@tk2msftngp13.phx.gbl...
> John,
> Are you starting Outlook fresh or is it already running? When Outlook is
> already running does the same thing happen?
>
> Does this happen "right away" or after using Outlook from VB.NET for
awhile?
>
> Are you using
System.Runtime.InteropServices.Marshal.ReelaseComO bject
on > each Outlook object returned, when you are done with that object?
>
> Are you calling Item.Display to show an item or just connecting and
> retrieving & updating information? Does this "slowness" happen with
specific
> Outlook objects & methods?
>
> Do you have other things running on your computer?
>
> Which version of the OS?
>
> Are you using Exchange Server or internet mode?
>
> Are you getting the "security dialog" that states that someone is
accessing
> your email? And just not seeing it in time?
>
>
> In case you don't have it, the following site provides a plethora of
> articles on using Outlook from .NET:
> http://www.microeye.com/resources/res_outlookvsnet.htm
>
> Using Outlook 2003 with VB.NET & the Office 2003 PIA I have not noticed > Outlook being slow to appear.
>
> Unfortunately I don't have a machine with either office 2000 or
Office XP.
>
> Hope this helps
> Jay
>
> "John" <jo**@nospam.infovis.co.uk> wrote in message
> news:%2****************@tk2msftngp13.phx.gbl...
> > Hi
> >
> > When I open a new outlook email from vb.net, sometimes outlook is

very
> slow
> > to appear or occasionally outlook freezes completely. I am

targeting mixed
> > office2000/xp environments so I am using the office2000 interop dlls > > generated by vs.net by adding office 2000 com reference.
> >
> > Any one else noticed this problem when targeting office2000/xp mixed > > environments? Is there a better, more robust way to do this? Am I

better
> off
> > using late binding?
> >
> > Thanks
> >
> > Regards
> >
> >
> >
> >
>
>



Nov 20 '05 #8
John,
Are you using Word as the Editor in Outlook?

There seems to be a problem closing Word when used as the Editor in Outlook,
try the following code to close Word.

Something like:
Dim app As New Outlook.Application
Dim mailItem As Outlook.MailItem
mailItem = DirectCast(app.CreateItem(Outlook.OlItemType.olMai lItem),
Outlook.MailItem)
Dim objInsp As Outlook.Inspector
objInsp = mailItem.GetInspector()

mailItem.Display(True)

Marshal.ReleaseComObject(objInsp)

Marshal.ReleaseComObject(mailItem)
Marshal.ReleaseComObject(app)

Note, the dialog is not displayed modally, but its left open for you to fill
out & send...

Hope this helps
Jay

"John" <jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi

Not sure how to relate the access example with outlook. Tried to mimic it
but no luck and same error. Isn't there an outlook example around, creating a new email then display and then cleanup?

Regards

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...
John,
Did you try searching MSDN for ReleaseComObject?

The first link returned looks like a promising example:

http://msdn.microsoft.com/library/de...omateVBNet.asp

The second link is the documentation for the function:

http://msdn.microsoft.com/library/de...bjecttopic.asp

Hope this helps
Jay
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
I am using display to allow user to enter the email and then press send button to send it. I am not using
System.Runtime.InteropServices.Marshal.ReelaseComO bject. Is there an

example
I can see on how to use it?

Thanks

Regards

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:OP**************@tk2msftngp13.phx.gbl...
> John,
> Are you starting Outlook fresh or is it already running? When Outlook is
> already running does the same thing happen?
>
> Does this happen "right away" or after using Outlook from VB.NET for
awhile?
>
> Are you using
System.Runtime.InteropServices.Marshal.ReelaseComO bject
on > each Outlook object returned, when you are done with that object?
>
> Are you calling Item.Display to show an item or just connecting and
> retrieving & updating information? Does this "slowness" happen with
specific
> Outlook objects & methods?
>
> Do you have other things running on your computer?
>
> Which version of the OS?
>
> Are you using Exchange Server or internet mode?
>
> Are you getting the "security dialog" that states that someone is
accessing
> your email? And just not seeing it in time?
>
>
> In case you don't have it, the following site provides a plethora of
> articles on using Outlook from .NET:
> http://www.microeye.com/resources/res_outlookvsnet.htm
>
> Using Outlook 2003 with VB.NET & the Office 2003 PIA I have not noticed > Outlook being slow to appear.
>
> Unfortunately I don't have a machine with either office 2000 or
Office XP.
>
> Hope this helps
> Jay
>
> "John" <jo**@nospam.infovis.co.uk> wrote in message
> news:%2****************@tk2msftngp13.phx.gbl...
> > Hi
> >
> > When I open a new outlook email from vb.net, sometimes outlook is

very
> slow
> > to appear or occasionally outlook freezes completely. I am

targeting mixed
> > office2000/xp environments so I am using the office2000 interop dlls > > generated by vs.net by adding office 2000 com reference.
> >
> > Any one else noticed this problem when targeting office2000/xp mixed > > environments? Is there a better, more robust way to do this? Am I

better
> off
> > using late binding?
> >
> > Thanks
> >
> > Regards
> >
> >
> >
> >
>
>



Nov 20 '05 #9

Thanks for that. It works fine the first time but calling the code second
time gives the following error;

Unhandled Exception: System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
System.Runtime.InteropServices.InvalidComObjectExc eption: COM object that
has been separated from its underlying RCW can not be used.
at Outlook.ApplicationEvents_EventProvider..ctor(Obje ct )

I am using the below code and the error comes on the 'OutlookApp = New
Outlook.Application' line. Any ideas what I am missing?

Thanks

Regards

= Code below =======================

Imports System.Runtime.InteropServices

Public Class clsOfficeWrapper
Private WithEvents OutlookApp As Outlook.Application
Private WithEvents em As Outlook.MailItem

Public Sub NewEmail(ByVal EmailTemplate As String, ByVal SendTo As String)
Dim ns As Outlook.NameSpace

OutlookApp = New Outlook.Application ' <=== This lines give the
exception second time round
ns = OutlookApp.GetNamespace("MAPI")
ns.Logon()

em = DirectCast(OutlookApp.CreateItemFromTemplate(Email Template),
Outlook.MailItem)
.To = SendTo
.Display(False)

Marshal.ReleaseComObject(em)
ns.Logoff()
Marshal.ReleaseComObject(ns)
Marshal.ReleaseComObject(OutlookApp)
End Sub
....

End Class

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
John,
How does that saying go: Give a man a fish he eats for a day, teach a man to fix he eats for live? :-)

The Access example should show you enough of the Concept of working with
Office Automation & ReleaseComObject when combined with the Outlook VBA Help you should be able to create a working example! As I find VB6 & VBA examples come are translated almost 1 for 1, the few exceptions to the rule I find
are easy to remember.
but no luck and same error. Isn't there an outlook example around, creating
a new email then display and then cleanup?

Unfortunately I am not setup to test Outlook 2000 automation with .NET.
However! others have used Outlook 2000 from VB.NET with success, have you
reviewed the info at:

http://www.microeye.com/resources/res_outlookvsnet.htm

There is at least one article that specifically deals specifically with
Outlook 2000!

Here is an example of "creating a new email, then display, and then
cleanup":

Imports System.Runtime.InteropServices
Dim app As New Outlook.Application
Dim ns As Outlook.NameSpace
ns = app.GetNamespace("MAPI")
ns.Logon()
Dim mailItem As Outlook.MailItem
mailItem =

DirectCast(app.CreateItem(Outlook.OlItemType.olMai lItem), Outlook.MailItem)
mailItem.Display(False)

Marshal.ReleaseComObject(mailItem)
ns.Logoff()
Marshal.ReleaseComObject(ns)
Marshal.ReleaseComObject(app)
Return

I am checking with my fellow Outlook MVPs on why mailItem.Display(True)
leaves the window on the screen.

Hope this helps
Jay
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi

Not sure how to relate the access example with outlook. Tried to mimic it
but no luck and same error. Isn't there an outlook example around,

creating
a new email then display and then cleanup?

Regards

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:uO**************@TK2MSFTNGP12.phx.gbl...
John,
Did you try searching MSDN for ReleaseComObject?

The first link returned looks like a promising example:

http://msdn.microsoft.com/library/de...omateVBNet.asp

The second link is the documentation for the function:

http://msdn.microsoft.com/library/de...bjecttopic.asp

Hope this helps
Jay
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
> I am using display to allow user to enter the email and then press send > button to send it. I am not using
> System.Runtime.InteropServices.Marshal.ReelaseComO bject. Is there an
example
> I can see on how to use it?
>
> Thanks
>
> Regards
>
> "Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in

message
> news:OP**************@tk2msftngp13.phx.gbl...
> > John,
> > Are you starting Outlook fresh or is it already running? When Outlook
is
> > already running does the same thing happen?
> >
> > Does this happen "right away" or after using Outlook from VB.NET for > awhile?
> >
> > Are you using

System.Runtime.InteropServices.Marshal.ReelaseComO bject
on
> > each Outlook object returned, when you are done with that object?
> >
> > Are you calling Item.Display to show an item or just connecting and > > retrieving & updating information? Does this "slowness" happen with > specific
> > Outlook objects & methods?
> >
> > Do you have other things running on your computer?
> >
> > Which version of the OS?
> >
> > Are you using Exchange Server or internet mode?
> >
> > Are you getting the "security dialog" that states that someone is
> accessing
> > your email? And just not seeing it in time?
> >
> >
> > In case you don't have it, the following site provides a plethora of > > articles on using Outlook from .NET:
> > http://www.microeye.com/resources/res_outlookvsnet.htm
> >
> > Using Outlook 2003 with VB.NET & the Office 2003 PIA I have not

noticed
> > Outlook being slow to appear.
> >
> > Unfortunately I don't have a machine with either office 2000 or

Office XP.
> >
> > Hope this helps
> > Jay
> >
> > "John" <jo**@nospam.infovis.co.uk> wrote in message
> > news:%2****************@tk2msftngp13.phx.gbl...
> > > Hi
> > >
> > > When I open a new outlook email from vb.net, sometimes outlook is very
> > slow
> > > to appear or occasionally outlook freezes completely. I am targeting > mixed
> > > office2000/xp environments so I am using the office2000 interop dlls > > > generated by vs.net by adding office 2000 com reference.
> > >
> > > Any one else noticed this problem when targeting office2000/xp mixed > > > environments? Is there a better, more robust way to do this? Am I better
> > off
> > > using late binding?
> > >
> > > Thanks
> > >
> > > Regards
> > >
> > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #10
I am not using word as editor.

Thanks

Regards
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:e9**************@TK2MSFTNGP11.phx.gbl...
John,
Are you using Word as the Editor in Outlook?

There seems to be a problem closing Word when used as the Editor in Outlook, try the following code to close Word.

Something like:
Dim app As New Outlook.Application
Dim mailItem As Outlook.MailItem
mailItem = DirectCast(app.CreateItem(Outlook.OlItemType.olMai lItem), Outlook.MailItem)
Dim objInsp As Outlook.Inspector
objInsp = mailItem.GetInspector()

mailItem.Display(True)

Marshal.ReleaseComObject(objInsp)

Marshal.ReleaseComObject(mailItem)
Marshal.ReleaseComObject(app)

Note, the dialog is not displayed modally, but its left open for you to fill out & send...

Hope this helps
Jay

"John" <jo**@nospam.infovis.co.uk> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi

Not sure how to relate the access example with outlook. Tried to mimic it
but no luck and same error. Isn't there an outlook example around,

creating
a new email then display and then cleanup?

Regards

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:uO**************@TK2MSFTNGP12.phx.gbl...
John,
Did you try searching MSDN for ReleaseComObject?

The first link returned looks like a promising example:

http://msdn.microsoft.com/library/de...omateVBNet.asp

The second link is the documentation for the function:

http://msdn.microsoft.com/library/de...bjecttopic.asp

Hope this helps
Jay
"John" <jo**@nospam.infovis.co.uk> wrote in message
news:Ot**************@tk2msftngp13.phx.gbl...
> I am using display to allow user to enter the email and then press send > button to send it. I am not using
> System.Runtime.InteropServices.Marshal.ReelaseComO bject. Is there an
example
> I can see on how to use it?
>
> Thanks
>
> Regards
>
> "Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in

message
> news:OP**************@tk2msftngp13.phx.gbl...
> > John,
> > Are you starting Outlook fresh or is it already running? When Outlook
is
> > already running does the same thing happen?
> >
> > Does this happen "right away" or after using Outlook from VB.NET for > awhile?
> >
> > Are you using

System.Runtime.InteropServices.Marshal.ReelaseComO bject
on
> > each Outlook object returned, when you are done with that object?
> >
> > Are you calling Item.Display to show an item or just connecting and > > retrieving & updating information? Does this "slowness" happen with > specific
> > Outlook objects & methods?
> >
> > Do you have other things running on your computer?
> >
> > Which version of the OS?
> >
> > Are you using Exchange Server or internet mode?
> >
> > Are you getting the "security dialog" that states that someone is
> accessing
> > your email? And just not seeing it in time?
> >
> >
> > In case you don't have it, the following site provides a plethora of > > articles on using Outlook from .NET:
> > http://www.microeye.com/resources/res_outlookvsnet.htm
> >
> > Using Outlook 2003 with VB.NET & the Office 2003 PIA I have not

noticed
> > Outlook being slow to appear.
> >
> > Unfortunately I don't have a machine with either office 2000 or

Office XP.
> >
> > Hope this helps
> > Jay
> >
> > "John" <jo**@nospam.infovis.co.uk> wrote in message
> > news:%2****************@tk2msftngp13.phx.gbl...
> > > Hi
> > >
> > > When I open a new outlook email from vb.net, sometimes outlook is very
> > slow
> > > to appear or occasionally outlook freezes completely. I am targeting > mixed
> > > office2000/xp environments so I am using the office2000 interop dlls > > > generated by vs.net by adding office 2000 com reference.
> > >
> > > Any one else noticed this problem when targeting office2000/xp mixed > > > environments? Is there a better, more robust way to do this? Am I better
> > off
> > > using late binding?
> > >
> > > Thanks
> > >
> > > Regards
> > >
> > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jawahar Rajan | last post by:
All, I am using the ASP code below to save some data from a SQL Server database via ADO as an Excel spreadsheet strReportName = Request.QueryString("ReportName") If len(strReportName) > 0 then...
0
by: Dhammika | last post by:
Outlook Express6 on Windows XP professional has suddenly became very slow to start.Once you click the icon the opening logo appears and thereafter it takes more than a minute to start outlook...
12
by: Neil | last post by:
I previously posted re. this, but thought I'd try again with a summary of facts. I have an Access 2000 MDB with a SQL Server 7 back end. There is a view that is linked to the database via ODBC...
2
by: Rocky A | last post by:
This is my first posting so please be gentle I've been writing access programs for only about a year and may have bit off more than I can chew but....... I've written an operations program for...
1
by: John | last post by:
Hi I have noticed that opening a new outlook email is much slower from vb.net than from vb/vba. I am targeting mixed office2000/officexp environments so I am using the office2000 interop dlls...
6
by: MadMan2004 | last post by:
Hello all! I'm having a problem with a project I'm working on and I'd like to ask for anyone's input that might be helpful. I'm building a rather large front-end application connecting to an...
50
by: diffuser78 | last post by:
I have just started to learn python. Some said that its slow. Can somebody pin point the issue. Thans
1
by: keri | last post by:
Hi, I use the below for the user to view their outlook calendar Sub DisplayInbox() Dim myolApp As Outlook.Application Dim myNameSpace As Outlook.NameSpace Dim myFolder As Outlook.MAPIFolder...
2
sivisr
by: sivisr | last post by:
Hi, i am using the following code to open outlook Express to send mail ,but i get " System.UnauthorizedAccessException: Access is denied. at WebApplication7.WebForm9.Button1_Click(Object...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.