![]() |
|
#1
|
|||
|
|||
|
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
Run-time error'-2147024891 (80070005)': Some ideas to force this copy?!?!? Tanks Fabrizio |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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")
tank Fabrizio |
|
|
|
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 |
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 |
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 |