Hi Amir. Try this macro:
Sub MoveSelectedEmailToInbox()
On Error GoTo EH:
Dim objMessage As Object
Dim objNS As NameSpace, objInbox As MAPIFolder
Dim intX As Integer
Set objNS = Application.GetNamespace("MAPI")
Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
For intX = Application.ActiveExplorer.Selection.Count To 1 Step -1
Set objMessage = Application.ActiveExplorer.Selection.Item(intX)
objMessage.Move objInbox
Next
Set objMessage = Nothing
Set objInbox = Nothing
Set objNS = Nothing
EH:
If Err.Number <> 0 Then
Stop
End If
End Sub
--
Eric Legault [MVP - Outlook]
MCDBA, MCTS (Messaging & Collaboration, SharePoint Infrastructure, MOSS 2007
& WSS 3.0 Application Development)
Collaborative Innovations
-> Try Picture Attachments Wizard For Microsoft Outlook <-
Web:
http://www.collaborativeinnovations.ca
Blog:
http://blogs.officezealot.com/legault
Amir Atary said:
Hello to all
I need help regarding writing a macro.
I would the follow senario to happen: when highlighting an email under
inbox i want to move it to inbox folder under personal folder (pst).
Any help will be appriciated.
Thank you very much
Amir