PDA

View Full Version : Solution - Does a BB sync with items moved from your inbox in Outlook


rcellini
08-20-2007, 03:00 AM
This always drives me crazy so I wrote an Outlook macro script which you can use to provide a solution.

The macro operates as follows. Once you select an email run the macro and it will do 2 things, 1) make a copy of the email and move it to the delete box and 2) open a chooser to allow you to move the email to a folder

The copy of the email fools the BB into thinking the email is deleted so it leaves your device. However you can still move it into your personal folders.

You can assign this macro to a button in your toolbar for easy access

Hope this helps everyone. I've been using it for a few weeks and really love it since it keeps my BB device in sync.

---

Sub ToFolder()
On Error Resume Next

Dim objFolder As Outlook.MAPIFolder, objTrash As Outlook.MAPIFolder, objInbox As Outlook.MAPIFolder
Dim objNS As Outlook.NameSpace, objItem As Outlook.MailItem

Set objNS = Application.GetNamespace("MAPI")

Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
Set objTrash = objInbox.Parent.Folders("Deleted Items")
Set objFolder = Outlook.Session.PickFolder

'Assume this is a mail folder

If objFolder Is Nothing Then
MsgBox "This folder doesn't exist!", vbOKOnly + vbExclamation, _
"INVALID FOLDER"
End If

If Application.ActiveExplorer.Selection.Count = 0 Then
'Require that this procedure be called only when a message is selected
Exit Sub
End If

For Each objItem In Application.ActiveExplorer.Selection
If objFolder.DefaultItemType = olMailItem Then
If objItem.Class = olMail Then
Set objCopy = objItem.Copy
objCopy.Move objTrash
objItem.Move objFolder
End If
End If
Next


Set objItem = Nothing
Set objCopy = Nothing
Set objFolder = Nothing
Set objInbox = Nothing
Set objNS = Nothing
End Sub