COM Addin to track email, Outlook, VB6 
Author Message
 COM Addin to track email, Outlook, VB6

Is it possible to create a COM addin that will simply write to a text file
the name of sender and date of email? I created an Addin in VB6 with the
Addin option at start up. All I have left is the Connect.DSR, which I placed
the following code:

        Dim olOutlook As Outlook.Application
        Dim WithEvents olMail As Outlook.Application

        Private Sub AddinInstance_OnConnection(ByVal Application As Object,
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode,             ByVal
AddInInst As Object, custom() As Variant)

            Set olMail = Outlook.Application
        End Sub

        Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As
AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)

            Set olMail = Nothing
        End Sub

        Private Sub olMail_NewMail()
        Dim myItems As Outlook.Items
        Dim olMailObject As Outlook.MailItem
        Dim intFreeFile As Integer

        Set myItems = Application.GetNamespace("MAPI").GetDefaultFolder

        Set olMailObject = myItems.Item(1)
        intFreeFile = FreeFile

        Open "C:\MailInfo.txt" For Append As intFreeFile
                Write #intFreeFile, olMailObject.SenderName,
        Close intFreeFile

        End Sub

My problem is that it will not fire off the New Mail event. Am I missing
something?  Thanks
                        Bill Mountford

Sun, 04 Jul 2004 00:54:14 GMT  
 COM Addin to track email, Outlook, VB6

Outlook2000 will not fire application-level events unless at least one
Explorer window is visible. Not sure if it is the cause in this situation.


This posting is provided ?AS IS?, with no warranties, and confers no

Mon, 05 Jul 2004 21:04:51 GMT  
 [ 2 post ] 

 Relevant Pages 

1. How to create a Com AddIn for Outlook 2000 with VB6 standard

2. Visual Basic AddIn Sourcecode for MS Outlook 2000 email de/en-cryption

3. Outlook COM AddIn Security

4. How can I insert a Controlbutton into an Outlook form using a COM-Addin

5. custom toolbar through com addin in outlook

6. COM addin under Outlook 98

7. SaveAs Dialog for Outlook Com AddIn

8. COM Addin for Outlook 97

9. COM C++ Addin for Outlook 2000 failing

10. COM addin under Outlook 98

11. Deploying an Outlook 2000 COM-AddIn

12. Outlook Project Conversion to COM AddIn


Powered by phpBB® Forum Software