Solved

VBA for Outlook

Posted on 2002-03-19
3
212 Views
Last Modified: 2008-03-06
For every message in my Outlook "XYZ" folder of incoming items, I want to collect the following information:
a) date sent
b) E-mail address
c) Subject Line
d) Icon (replied, forwarded or nothing)

if (d) is replied or forwarded, then I would like to find the reply in my Sent Items folder and capture
e) date of reply/forward
f) text of reply/forward
g) time spent editing reply/forward would be a huge plus

The output would go to Access or Excel or a text file or whatever.  I can handle writing the output.

I explored around the Outlook object model today, but couldn't even manage to loop through each mailitem in the CurrentFolder.  I really got stopped when trying to find the replies - didn't seem to be any property even remotely related to that.

No need for complete answers - even if you have some piece of this answer, that would be great.

Bill


0
Comment
Question by:jelen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 100 total points
ID: 6881746
Hi Bill,

Then i think you'll find what you at teh slipstick site

http://www.slipstick.com/dev/code/getsenderaddy.htm
http://www.slipstick.com/dev/vb.htm

and to round it up a more general page with links on how to program in outlook, but first check ou the lsipstick site there wil be samples on everythign you need like the first link shows

http://www.outlookexchange.com/articles/home/outlooklinks.asp

HTH:O)Bruintje

0
 
LVL 1

Author Comment

by:jelen
ID: 6899278
Bruntje,

Thanks for the links.  In case anyone ever buys the question in the future, here is the VBA which I built from those links:

Public Sub InboxSendDates()

    Dim objNameSpace As NameSpace
    Dim objMAPIFolder As MAPIFolder
    Dim objMailItem As MailItem
    Dim lngOldMailCounter As Long
    Dim lngNewMailCounter As Long
    Dim oExcel As Object
       
    Set oExcel = CreateObject("Excel.Application")
    oExcel.Workbooks.Add
    Dim WB As Workbook
    Set WB = oExcel.ActiveWorkbook
    Dim WS As Worksheet
    Set WS = WB.ActiveSheet
    Ctr = 1
    oExcel.Visible = True
       
    Set objNameSpace = GetNamespace(Type:="MAPI")
    Set objMAPIFolder = _
          objNameSpace.Folders("Personal Folders").Folders("Sent Items")
          'objNameSpace.Folders("Personal Folders").Folders("Ask MrExcel").Folders("Quotes")
   
    For Each objMailItem In objMAPIFolder.Items
        Ctr = Ctr + 1
        If Ctr > 1717 Then
            MyCtr = Ctr - 1717
            On Error Resume Next
             WS.Cells(MyCtr, 1).Resize(1, 9).Value = Array( _
                objMailItem.SenderName, _
                objMailItem.SentOn, _
                objMailItem.Subject, _
                objMailItem.To, _
                objMailItem.CreationTime, _
                objMailItem.MessageClass, _
                objMailItem.ConversationTopic, _
                objMailItem.ConversationIndex, _
                objMailItem.Body _
                )
            On Error GoTo 0
        End If
   
    Next objMailItem
   
       
End Sub

Bill
0
 
LVL 44

Expert Comment

by:bruintje
ID: 6899817
thanks for the grade
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel vlookup and or INDEX and MATCH 16 45
Excel 2016 lost MRU list 8 66
Need take combination of numbers out of the list 6 14
Excel with two IF statements 3 3
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
Outlook Free & Paid Tools
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question