Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VBA for Outlook

Posted on 2002-03-19
3
Medium Priority
?
220 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 400 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

618 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