msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Outlook.exe can't close it

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook
Author Message
"Werner_Faßbender



Joined: 09 Jan 2008
Posts: 11

PostPosted: Sun Jan 27, 2008 3:17 pm    Post subject: Outlook.exe can't close it Reply with quote

Hello,

I'm using OL2003, AC97, WinXP

I can't close Outllok.exe.
To make a copy of the Outlook.pst I'm using this code.
But after this code outlook.exe is still running.
How can I close it?

-------------------------------------------------------------------------------
Dim myolApp As Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder

Set myolApp = CreateObject("Outlook.Application")
Set myNameSpace = myolApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderContacts)

getPSTPath = GetPathFromStoreID(myFolder.StoreID)

routine_exit:
myolApp.Quit
If Not myFolder Is Nothing Then Set myFolder = Nothing
If Not myNameSpace Is Nothing Then Set myNameSpace = Nothing
If Not myolApp Is Nothing Then Set myolApp = Nothing
------------------------------------------------------------------------------------


Thanks a lot
best regards
Werner

Archived from group: microsoft>public>office>developer>outlook>vba
Back to top
View user's profile Send private message
Ken Slovak - [MVP - Outlo



Joined: 12 Aug 2007
Posts: 405

PostPosted: Sun Jan 27, 2008 9:17 pm    Post subject: Re: Outlook.exe can't close it Reply with quote

Try releasing the NameSpace and MAPIFolder objects first before calling
..Quit

--
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


"Werner Faßbender" wrote in message @u10g2000prn.googlegroups.com...
> Hello,
>
> I'm using OL2003, AC97, WinXP
>
> I can't close Outllok.exe.
> To make a copy of the Outlook.pst I'm using this code.
> But after this code outlook.exe is still running.
> How can I close it?
>
> -------------------------------------------------------------------------------
> Dim myolApp As Outlook.Application
> Dim myNameSpace As Outlook.NameSpace
> Dim myFolder As Outlook.MAPIFolder
>
> Set myolApp = CreateObject("Outlook.Application")
> Set myNameSpace = myolApp.GetNamespace("MAPI")
> Set myFolder = myNameSpace.GetDefaultFolder(olFolderContacts)
>
> getPSTPath = GetPathFromStoreID(myFolder.StoreID)
>
> routine_exit:
> myolApp.Quit
> If Not myFolder Is Nothing Then Set myFolder = Nothing
> If Not myNameSpace Is Nothing Then Set myNameSpace = Nothing
> If Not myolApp Is Nothing Then Set myolApp = Nothing
> ------------------------------------------------------------------------------------
>
>
> Thanks a lot
> best regards
> Werner
>
Back to top
View user's profile Send private message
"Werner_Faßbender



Joined: 09 Jan 2008
Posts: 11

PostPosted: Sun Jan 27, 2008 10:55 pm    Post subject: Re: Outlook.exe can't close it Reply with quote

> Try releasing the NameSpace and MAPIFolder objects first before calling
> .Quit
>

OK I've done that.

Outlook.exe is not longer visible in the taskmanager.
But the FileCopy of the Outlook.pst fires error 70, same as before.

'** 1. this works:
strUserPfad = Environ("USERPROFILE")
strUserPfad = strUserPfad & "\Lokale Einstellungen\Anwendungsdaten
\Microsoft\Outlook\"
strUserPfad_Appl = strUserPfad & "Outlook.pst"

----------------------------------------------------------------------

'** 2. this doesn't works:
strUserPfad_Appl = Trim(getPSTPath) ' code see above

----------------------------------------------------------------------

when I substitute the path by a constant string (1) it works.
when I determine the path by this methode (2) something blocked
the outlook.pst file.

thanks a lot
Werner
Back to top
View user's profile Send private message
Ken Slovak - [MVP - Outlo



Joined: 12 Aug 2007
Posts: 405

PostPosted: Mon Jan 28, 2008 3:34 pm    Post subject: Re: Outlook.exe can't close it Reply with quote

I have no idea what your getPSTPath method is or does so I have no idea how
it works and why it's not working for you as expected. Your previous post
didn't mention anything about any error 70. What results are you getting
from that method as opposed to your #1 method?

Outlook will also lock a PST file for a period of time after Outlook closes,
you have to account for that.

--
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


"Werner Faßbender" wrote in message @s12g2000prg.googlegroups.com...
>> Try releasing the NameSpace and MAPIFolder objects first before calling
>> .Quit
>>
>
> OK I've done that.
>
> Outlook.exe is not longer visible in the taskmanager.
> But the FileCopy of the Outlook.pst fires error 70, same as before.
>
> '** 1. this works:
> strUserPfad = Environ("USERPROFILE")
> strUserPfad = strUserPfad & "\Lokale Einstellungen\Anwendungsdaten
> \Microsoft\Outlook\"
> strUserPfad_Appl = strUserPfad & "Outlook.pst"
>
> ----------------------------------------------------------------------
>
> '** 2. this doesn't works:
> strUserPfad_Appl = Trim(getPSTPath) ' code see above
>
> ----------------------------------------------------------------------
>
> when I substitute the path by a constant string (1) it works.
> when I determine the path by this methode (2) something blocked
> the outlook.pst file.
>
> thanks a lot
> Werner
>
>
Back to top
View user's profile Send private message
"Werner_Faßbender



Joined: 09 Jan 2008
Posts: 11

PostPosted: Mon Jan 28, 2008 8:09 pm    Post subject: Re: Outlook.exe can't close it Reply with quote

> I have no idea what your getPSTPath method is or does so I have no
> idea
how
> it works and why it's not working for you as expected. Your previous
> post didn't mention anything about any error 70. What results are you
> getting from that method as opposed to your #1 method?

Sorry for my inconvenience.

Here is what the function does:
---------------------------------------------------------------------
Function dasiOutlook() As Boolean
Dim strUserPfad As String
Dim strUserPfad_Appl As String
Dim strNow As String


On Error GoTo routine_err
dasiOutlook = False

strUserPfad_Appl = Trim(getPSTPath) '*************** see the
following function ***************

If Len(Dir(strUserPfad_Appl)) > 0 Then
strNow = replace_telefon(Now())
FileCopy strUserPfad_Appl, strUserPfad_Appl & "_" & strNow
'*************** Error 70 occurs ***************
dasiOutlook = True
Else
MsgBox "Datei Outlook.pst nicht gefunden. Sicherungskopie von
Outlook kann nicht erstellt werden." & vbLf & vbLf & _
"Synchronisation RAMIGOS --> OUTLOOK wird nicht
durchgeführt." & vbLf & vbLf & _
strUserPfad_Appl
End If

routine_exit:
Exit Function

routine_err:
Select Case Err
Case 70 'Access denied
MsgBox "A backup copy of the outlook.pst can't be
make."
Call SubWriteLog("dasiOutlook", Err.Number & " "
& Err.Description & " " & Application.CurrentObjectName)
Resume routine_exit
Case Else
MsgBox Err & " " & Err.Description & " " &
Application.CurrentObjectName
Call SubWriteLog("dasiOutlook", Err.Number & " " &
Err.Description & " " & Application.CurrentObjectName)

Resume routine_exit
End Select

End Function
----------------------------------------------------------------------------
------
----------------------------------------------------------------------------
------
Public Function getPSTPath() As String
Dim myolApp As Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder

On Error GoTo routine_err

Set myolApp = CreateObject("Outlook.Application")
Set myNameSpace = myolApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderContacts)

getPSTPath = GetPathFromStoreID(myFolder.StoreID)

routine_exit:

If Not myFolder Is Nothing Then Set myFolder = Nothing
If Not myNameSpace Is Nothing Then Set myNameSpace = Nothing
myolApp.Quit
If Not myolApp Is Nothing Then Set myolApp = Nothing

Exit Function

routine_err:
Select Case Err
Case Else
MsgBox Err & " " & Err.Description & " " &
Application.CurrentObjectName
Call SubWriteLog("fncReSo", Err.Number & " " &
Err.Description & " " & Application.CurrentObjectName)
Resume routine_exit
End Select
----------------------------------------------------------------------------
-----

>>What results are you getting
>>from that method as opposed to your #1 method?

This command fires Err 70 = "Access denied"
FileCopy strUserPfad_Appl, strUserPfad_Appl & "_" & strNow
'*************** Error 70 occurs ***************

Thanks a lot
and best regards
Werner
Back to top
View user's profile Send private message
Ken Slovak - [MVP - Outlo



Joined: 12 Aug 2007
Posts: 405

PostPosted: Mon Jan 28, 2008 11:32 pm    Post subject: Re: Outlook.exe can't close it Reply with quote

OK, you're keeping me guessing. What's the code for GetPathFromStoreID()?

Have you compared what you get back from method 1 and method 2? Are they the
same?

For the method where you hard code the path are you using any Outlook object
model code? If not then are you accounting for the time that the PST file
will remain locked after you call Quit on the Outlook.Application object?
Try waiting a few minutes.

--
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


"Werner Faßbender" wrote in message @i72g2000hsd.googlegroups.com...

> I have no idea what your getPSTPath method is or does so I have no
> idea
how
> it works and why it's not working for you as expected. Your previous
> post didn't mention anything about any error 70. What results are you
> getting from that method as opposed to your #1 method?

Sorry for my inconvenience.

Here is what the function does:
---------------------------------------------------------------------
Function dasiOutlook() As Boolean
Dim strUserPfad As String
Dim strUserPfad_Appl As String
Dim strNow As String


On Error GoTo routine_err
dasiOutlook = False

strUserPfad_Appl = Trim(getPSTPath) '*************** see the
following function ***************

If Len(Dir(strUserPfad_Appl)) > 0 Then
strNow = replace_telefon(Now())
FileCopy strUserPfad_Appl, strUserPfad_Appl & "_" & strNow
'*************** Error 70 occurs ***************
dasiOutlook = True
Else
MsgBox "Datei Outlook.pst nicht gefunden. Sicherungskopie von
Outlook kann nicht erstellt werden." & vbLf & vbLf & _
"Synchronisation RAMIGOS --> OUTLOOK wird nicht
durchgeführt." & vbLf & vbLf & _
strUserPfad_Appl
End If

routine_exit:
Exit Function

routine_err:
Select Case Err
Case 70 'Access denied
MsgBox "A backup copy of the outlook.pst can't be
make."
Call SubWriteLog("dasiOutlook", Err.Number & " "
& Err.Description & " " & Application.CurrentObjectName)
Resume routine_exit
Case Else
MsgBox Err & " " & Err.Description & " " &
Application.CurrentObjectName
Call SubWriteLog("dasiOutlook", Err.Number & " " &
Err.Description & " " & Application.CurrentObjectName)

Resume routine_exit
End Select

End Function
----------------------------------------------------------------------------
------
----------------------------------------------------------------------------
------
Public Function getPSTPath() As String
Dim myolApp As Outlook.Application
Dim myNameSpace As Outlook.NameSpace
Dim myFolder As Outlook.MAPIFolder

On Error GoTo routine_err

Set myolApp = CreateObject("Outlook.Application")
Set myNameSpace = myolApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderContacts)

getPSTPath = GetPathFromStoreID(myFolder.StoreID)

routine_exit:

If Not myFolder Is Nothing Then Set myFolder = Nothing
If Not myNameSpace Is Nothing Then Set myNameSpace = Nothing
myolApp.Quit
If Not myolApp Is Nothing Then Set myolApp = Nothing

Exit Function

routine_err:
Select Case Err
Case Else
MsgBox Err & " " & Err.Description & " " &
Application.CurrentObjectName
Call SubWriteLog("fncReSo", Err.Number & " " &
Err.Description & " " & Application.CurrentObjectName)
Resume routine_exit
End Select
----------------------------------------------------------------------------
-----

>>What results are you getting
>>from that method as opposed to your #1 method?

This command fires Err 70 = "Access denied"
FileCopy strUserPfad_Appl, strUserPfad_Appl & "_" & strNow
'*************** Error 70 occurs ***************

Thanks a lot
and best regards
Werner
Back to top
View user's profile Send private message
"Werner_Faßbender



Joined: 09 Jan 2008
Posts: 11

PostPosted: Tue Jan 29, 2008 5:02 am    Post subject: Re: Outlook.exe can't close it Reply with quote

On 29 Jan., 00:32, "Ken Slovak - [MVP - Outlook]"
wrote:
> OK, you're keeping me guessing. What's the code for GetPathFromStoreID()?
>

Public Function GetPathFromStoreID(sStoreID As String) As String
'Entslüsselt den Pfad zur PST Datei

Dim I As Long
Dim lPos As Long
Dim sRes As String

On Error Resume Next

For I = 1 To Len(sStoreID) Step 2
sRes = sRes & Chr("&h" & Mid$(sStoreID, I, 2))
Next


'sRes = Replace(sRes, Chr(0), vbNullString)
lPos = InStr(sRes, ":\")


If lPos Then
GetPathFromStoreID = Right$(sRes, (Len(sRes)) - (lPos - 2))
End If

End Function
-----------------------------------------------------------------------------
> Have you compared what you get back from method 1 and method 2? Are they the
> same?
>
methode 1 with the hard coded path is working well.


> For the method where you hard code the path are you using any Outlook object
> model code?
No I diden't use the outlook object model for the hard coded path

>If not then are you accounting for the time that the PST file
> will remain locked after you call Quit on the Outlook.Application object?
> Try waiting a few minutes.
>
wait 5 Minutes error 70 still going on

Best regards
werner
Back to top
View user's profile Send private message
Ken Slovak - [MVP - Outlo



Joined: 12 Aug 2007
Posts: 405

PostPosted: Tue Jan 29, 2008 3:49 pm    Post subject: Re: Outlook.exe can't close it Reply with quote

Did you compare the results from method 1 and 2 to see if they are
identical? If they are identical are you sure that outlook.exe is not still
listed in the Processes tab of the Task Manager? Are you holding any Outlook
objects open?

--
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


"Werner Faßbender" wrote in message @q39g2000hsf.googlegroups.com...
On 29 Jan., 00:32, "Ken Slovak - [MVP - Outlook]"
wrote:
> OK, you're keeping me guessing. What's the code for GetPathFromStoreID()?
>

Public Function GetPathFromStoreID(sStoreID As String) As String
'Entslüsselt den Pfad zur PST Datei

Dim I As Long
Dim lPos As Long
Dim sRes As String

On Error Resume Next

For I = 1 To Len(sStoreID) Step 2
sRes = sRes & Chr("&h" & Mid$(sStoreID, I, 2))
Next


'sRes = Replace(sRes, Chr(0), vbNullString)
lPos = InStr(sRes, ":\")


If lPos Then
GetPathFromStoreID = Right$(sRes, (Len(sRes)) - (lPos - 2))
End If

End Function
-----------------------------------------------------------------------------
> Have you compared what you get back from method 1 and method 2? Are they
> the
> same?
>
methode 1 with the hard coded path is working well.


> For the method where you hard code the path are you using any Outlook
> object
> model code?
No I diden't use the outlook object model for the hard coded path

>If not then are you accounting for the time that the PST file
> will remain locked after you call Quit on the Outlook.Application object?
> Try waiting a few minutes.
>
wait 5 Minutes error 70 still going on

Best regards
werner

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
losing mail body content after close event of mailItem Hello, I have a mail item and I tried to add some text to this mail item by the following code = new MailItem = = "<

Outlook ignoring html font tag - VBA - Access 2007 & Outlook Seeing another pair of eyes to tell me where I'm missing some key element. My code below works fine to create a message however the font tag is ignored and everything comes out as Times New Roman 12pt. Any assist would be greatly appreciated. strMailMsg

i made a plugin of outlook that crashes in outlook 2007 on v Hi I am facing a Problem that i have made a plugin in Visual Studio 2000 using VC6.0 that is running fine in outlook 2003 and on all the operating but when i run that plugin on Outlook2007 installed on Microsoft Vista( licensed )

Add Outlook Express feature to Outlook - autocomplete I've got a user who doesn't want to switch from Outlook Express to Outlook because Outlook doesn't have the autocomplete for emails addresses. I know you can type in a few characters and then hit ctrl-k, but it would be much easier on me if I could make

Problems with shutdown in Outlook 2007 when using Outlook Ob Hi, I've written an application that logs into Outlook, accesses some of the user's data, and logs out. A problem occurs if I run the application twice in a row, without waiting long after the application exits the first time. The first time the program
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group