No announcement yet.

Need help converting to PB COM code

  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

    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
    End If
    Next lDraftItem
    Set myDraftsFolder = Nothing
    Set myNameSpace = Nothing
    Set myOutlook = Nothing
    End Sub
    Bob Mechler

  • #2
    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