Announcement

Collapse
No announcement yet.

Need help converting to PB COM code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • BOB MECHLER
    replied
    I put the above code into VBA in Outlook and called it as a Macro and it took everything in the draft folder and sent it with out having to open items and press Alt-S a ton of times. I'd like to see if it works the same when written in PB COM code.

    Bob Mechler

    Leave a comment:


  • BOB MECHLER
    started a topic Need help converting to PB COM code

    Need help converting to PB COM code

    The following VBA code from a Google search is proving hard to convert to PB using COM. Anyone care to take a stab at it?

    Code:
    Set myOutlook = Outlook.Application
    Set myNameSpace = myOutlook.GetNamespace("MAPI")
    Set myFolders = myNameSpace.Folders
    
    'Set Draft Folder.  
    
    Set myDraftsFolder = myFolders("put name of the parent folder of your
    draft folder in here").Folders("Drafts")
    
    'Loop through all Draft Items
    
    For lDraftItem = myDraftsFolder.Items.Count To 1 Step -1
    
    'Check for "To" address and only send if "To" is filled in.
    
    If Len(Trim(myDraftsFolder.Items.Item(lDraftItem).To)) > 0 Then
    
    'Send Item
    
    myDraftsFolder.Items.Item(lDraftItem).Send
    
    End If
    Next lDraftItem
    
    'Clean-up
    
    Set myDraftsFolder = Nothing
    Set myNameSpace = Nothing
    Set myOutlook = Nothing
    
    End Sub
    Bob Mechler
Working...
X