Re: Close document
- From: Peter Marchert <mpnews2@xxxxxxxx>
- Date: Sun, 04 Nov 2007 05:25:07 -0800
Hello,
set the mailitem to nothing before using it again:
Sub macros(fileNameMSG, fileNameRTF)
Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myMailItem As Outlook.MailItem
Set myolApp = Outlook.Application
Set myNamespace = myolApp.GetNamespace("MAPI")
Set myMailItem = myNamespace.OpenSharedItem(fileNameMSG)
myMailItem.SaveAs fileNameRTF, olRTF
myMailItem.Close olDiscard
Set myMailItem = Nothing
Set myMailItem = myNamespace.OpenSharedItem(fileNameMSG)
myMailItem.Close olDiscard
End Sub
Peter
On 4 Nov., 11:44, boltnia <bolt...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
In code
Sub macros(fileNameMSG, fileNameRTF)
Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myMailItem As Outlook.MailItem
Set myolApp = Outlook.Application
Set myNamespace = myolApp.GetNamespace("MAPI")
Set myMailItem = myNamespace.OpenSharedItem(fileNameMSG)
myMailItem.SaveAs fileNameRTF, olRTF
myMailItem.Close olDiscard
Set myMailItem = myNamespace.OpenSharedItem(fileNameMSG)
myMailItem.Close olDiscard
End Sub
Before second opening file - it is generated error. When I check file - it
is locked. So, what I have to do to unlock file after closing?
Thanks
.
- Prev by Date: Error when creating 247 appointments in exchange mailbox
- Next by Date: Re: Outlook View Control: Viewctl
- Previous by thread: Error when creating 247 appointments in exchange mailbox
- Next by thread: Re: Outlook View Control: Viewctl
- Index(es):
Relevant Pages
|