Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-19-2013, 08:05 AM
fcarboni fcarboni is offline Vault lock mail copy Windows Vista Vault lock mail copy Office 2007
Novice
Vault lock mail copy
 
Join Date: Aug 2013
Posts: 2
fcarboni is on a distinguished road
Default Vault lock mail copy

My company from 1 week use Vault Enterprise, then I can't able to move my personal mail to an external pst folder.


Ialso tried with VBA code:
Code:
Sub bt1_Click() 
Dim olApp As New Outlook.Application
Dim olNameSpace As Outlook.Namespace
Dim FromFolder As Outlook.MAPIFolder
Dim ToFolder As Outlook.MAPIFolder
Dim FromSubFolder As Outlook.MAPIFolder
Dim ToSubFolder As Outlook.MAPIFolder
Dim mailboxNameString As String
Dim myInspectors As Outlook.MailItem
Dim myCopiedInspectors As Outlook.MailItem
Dim myItem As Outlook.MailItem
Dim M As Integer
Dim iCount As Integer
Set olNameSpace = olApp.GetNamespace("MAPI")
Set FromFolder = olNameSpace.GetDefaultFolder(olFolderInbox)
Set FromSubFolder = FromFolder.Folders("moveFrom")
Set ToFolder = olNameSpace.Folders("ArchivioPst_personal")
Set ToSubFolder = ToFolder.Folders("Posta_gestita")

For M = 1 To FromSubFolder.Items.Count
    Set myItem = FromSubFolder.Items(M)
    myItem.Display
    Set myInspectors = Outlook.Application.ActiveInspector.CurrentItem
    Set myCopiedInspectors = myInspectors.Copy
    myCopiedInspectors.Move ToSubFolder
    myInspectors.Close olDiscard
Next M
end sub
But i received this error:
Run-time error'-2147024891 (80070005)':


Some ideas to force this copy?!?!?
Tanks
Fabrizio
Reply With Quote
  #2  
Old 08-19-2013, 09:57 AM
msperry msperry is offline Vault lock mail copy Windows 7 64bit Vault lock mail copy Office 2010 64bit
Competent Performer
 
Join Date: Jul 2011
Location: Jacksonville, Florida, US
Posts: 141
msperry is on a distinguished road
Default

Hi,

The problem is that the Outlook Application object cannot be initialized with a New statement, you need to grab the copy of Outlook that is already running like so:

Dim olApp As Outlook.Application
olApp = GetObject(, "Outlook.Application")

BTW, you might be better off to check out the Outlook programmers forum at http://social.msdn.microsoft.com/For...rum=outlookdev, or possibly http://www.outlookcode.com/.

Good luck!

- Mike
Reply With Quote
  #3  
Old 08-24-2013, 01:26 AM
fcarboni fcarboni is offline Vault lock mail copy Windows Vista Vault lock mail copy Office 2007
Novice
Vault lock mail copy
 
Join Date: Aug 2013
Posts: 2
fcarboni is on a distinguished road
Default

ciao Mike,
the problem isn't
Dim olApp As New Outlook.Application because if i try to move to the same pst (different folder) the code play regular:
Code:
 
Set olNameSpace = olApp.GetNamespace("MAPI")
Set FromFolder = olNameSpace.GetDefaultFolder(olFolderInbox)
Set FromSubFolder = FromFolder.Folders("moveFrom")
Set ToFolder = olNameSpace.GetDefaultFolder("olFolderInbox")
Set ToSubFolder = ToFolder.Folders("Posta_gestita")
The default pst is exchange mail personal folder, and i think that is loked from Vault E., with any way is possible to move from this pst to external...;-(.
tank
Fabrizio
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Copy data from Outlook mail and Paste it in a Excel sheet? padhu1989 Outlook 0 09-11-2012 04:07 AM
Vault lock mail copy Why does Word lock up when copy & paste from internet site? Endzone Word 1 08-28-2012 08:25 AM
Do I need 'AVG Virus Vault' folder if not using AVG? Ulodesk Outlook 0 05-27-2012 05:57 PM
Using a rule: How do I include a copy of the original e-mail message when sending an Emerogork Outlook 0 04-09-2012 07:11 AM
Vault lock mail copy how to download a copy of the mail arriving at Gmail and to my work email on my hdd alpha_Fqc9 Outlook 1 02-13-2012 11:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft