Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 0.73 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Outlook 2007 VBA - apply action only when in specific Outlook account
  2. Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
  3. If MsgBox("Send with 'Myrtleford Festival" at start of subject?", vbYesNo, "Send as Festival mail") = vbYes Then
  4.         If (Left(Trim(Item.Subject), 11)) <> "The " Then
  5.     Item.Subject = "The Myrtleford Festival 2012/ " + Item.Subject
  6.     End If
  7. End If
  8.        
  9. Personal Folders
  10. Archive Folders
  11. Test Folders
  12.        
  13. Sub AnswerA()
  14.  
  15.   Dim InxIFLCrnt As Integer
  16.   Dim TopLvlFolderList As Folders
  17.  
  18.   Set TopLvlFolderList = _
  19.           CreateObject("Outlook.Application").GetNamespace("MAPI").Folders
  20.  
  21.   For InxIFLCrnt = 1 To TopLvlFolderList.Count
  22.     Debug.Print TopLvlFolderList(InxIFLCrnt).Name
  23.   Next
  24.  
  25. End Sub