Group:  Microsoft Outlook ยป microsoft.public.outlook.program_forms
Thread: Outlook2003 -> OLE (MAPFolder->Display())

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Outlook2003 -> OLE (MAPFolder->Display())
"friedemannkunze via OfficeKB.com" <u15762[ at ]uwe> 01.09.2006 07:20:25
Dear Members,
i've the problem with outlook 2003, that it does not terminate correctly if
the user is closing outlook normally.
The reason for this behaviour is, I get the outlook application object with
GetObject("Outlook.Application") and I try to show a specific folder from
outlook like calendar or tasks. After I call the method Folder->Dispplay I
release all used objects. But if then the user is closing outlook normally,
it switches into the windows systray-menue. There it's impossible for the
user to work with outlook - it's not possible to open it. The only way to
close outlook then, is to kill the process over the taskmanager.
I was able to limit the problem: The cause is to show a folder to the user.
Instead of using the method "Display",I've tried to use "Activate". But here
is the same problem as above.

Following, you can take a look at my sample script with which the problem can
be reproduced:
Option Explicit
Dim oOutlook
On Error Resume Next
Set oOutlook = GetObject(,"Outlook.Application")
If (Err.Number <> 0) Then
Set oOutlook = Nothing
WScript.Quit
End If
On Error GoTo 0
Dim oNameSpace
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
Dim oFolder
Set oFolder = oNameSpace.GetDefaultFolder(9)
oFolder.Display
Set oFolder = Nothing
Set oNameSpace = Nothing
Set oOutlook = Nothing

I thank you for your help.

Additional information:
The problem is not reprocueable with outlook 2002 and sample script above.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/outlook-prog-forms/200609/1

Re: Outlook2003 -> OLE (MAPFolder->Display())
"friedemannkunze via OfficeKB.com" <u15762[ at ]uwe> 04.09.2006 09:48:02
Hallo,

i found a solution for that problem respective an MS MVP shows me the
possible workaround.
He said:
[Quoted Text]
>Well, if your code is only running when Outlook has already been started you could set the folder to the >folder for the ActiveExplorer. That won't open any additional Explorer objects.
>Set oOutlook.ActiveExplorer.CurrentFolder = oFolder

And this works fine! Thanks a lot again!

friedemannkunze wrote:
>Dear Members,
>i've the problem with outlook 2003, that it does not terminate correctly if
>the user is closing outlook normally.
>The reason for this behaviour is, I get the outlook application object with
>GetObject("Outlook.Application") and I try to show a specific folder from
>outlook like calendar or tasks. After I call the method Folder->Dispplay I
>release all used objects. But if then the user is closing outlook normally,
>it switches into the windows systray-menue. There it's impossible for the
>user to work with outlook - it's not possible to open it. The only way to
>close outlook then, is to kill the process over the taskmanager.
>I was able to limit the problem: The cause is to show a folder to the user.
>Instead of using the method "Display",I've tried to use "Activate". But here
>is the same problem as above.
>
>Following, you can take a look at my sample script with which the problem can
>be reproduced:
>Option Explicit
>Dim oOutlook
>On Error Resume Next
>Set oOutlook = GetObject(,"Outlook.Application")
> If (Err.Number <> 0) Then
> Set oOutlook = Nothing
> WScript.Quit
> End If
>On Error GoTo 0
>Dim oNameSpace
>Set oNameSpace = oOutlook.GetNameSpace("MAPI")
>Dim oFolder
>Set oFolder = oNameSpace.GetDefaultFolder(9)
>oFolder.Display
>Set oFolder = Nothing
>Set oNameSpace = Nothing
>Set oOutlook = Nothing
>
>I thank you for your help.
>
>Additional information:
>The problem is not reprocueable with outlook 2002 and sample script above.

--
Message posted via http://www.officekb.com

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net