User Tools

Site Tools


start:promomail

This is an old revision of the document!


Promotional Email Settings

GMail account information

  • orders.picnicpromotions@gmail.com
  • Server settings (manually configure in Outlook 2010)
    • Incoming mail server: imap.gmail.com
    • Outgoing mail server: smtp.DoNotUse.com (email should only be sent from Picnic Time email addresses)
    • Server port number for incoming server (IMAP): 993 (Outlook 2010 More settings … Advanced)
    • Incoming server encrypted connection: SSL (Outlook 2010 More settings … Advanced)

Outlook VB Macro to copy mail to folder

  • To open the Visual Basic Editor
    • Click the Macros button on the Developer tab.
    • In the Macro dialog box that appears, type CopyToGmail under Macro Name.
    • Click the Create button to open the Visual Basic Editor with the outlines of a new macro already typed in.
  • Copy, paste and save the VBA code below into the Visual Basic Editor:
'Outlook VB Macro to copy selected mail item(s) to a target folder
Sub CopyToGmail()
On Error Resume Next

Dim ns As Outlook.NameSpace
Dim CopyToFolder As Outlook.MAPIFolder
Dim objItem As Outlook.MailItem

Set ns = Application.GetNamespace("MAPI")

'Define path to the target folder
Set CopyToFolder = ns.Folders("orders.picnicpromotions@gmail.com").Folders("Inbox")

If Application.ActiveExplorer.Selection.Count = 0 Then
   MsgBox ("No item selected")
   Exit Sub
End If

If CopyToFolder Is Nothing Then
   MsgBox "Target folder not found!", vbOKOnly + vbExclamation, "Copy Macro Error"
End If

For Each objItem In Application.ActiveExplorer.Selection
   If CopyToFolder.DefaultItemType = olMailItem Then
      If objItem.Class = olMail Then
         objItem.Copy CopyToFolder
         objItem.Move CopyToFolder
      End If
  End If
Next

Set objItem = Nothing
Set CopyToFolder = Nothing
Set ns = Nothing

End Sub
start/promomail.1491498727.txt.gz · Last modified: 2017/04/06 10:12 by andre