Advertisement

07.09.2008 at 07:20AM PDT, ID: 23550313
[x]
Attachment Details

IN VB6 I MAKE A CALL TO OULOOK TO GET MAILS,   I WANT TO DISABLE THE POPUP IN OUTLOOK THAT A PROGRAM ASK PERMISSION TO READ  DATA FROM OUTLOOK

Asked by BIAPRO in Programming Languages, Visual Basic Programming, Microsoft Operating Systems

Tags: microsoft, outlook 2003, windows xp, VB6, vb6

I read from outlook 2003 the mails,    I looking for a option to disable the pop-up  from outlook that my program wants to access outlook, i can only give permission for max 10.minutes (every time again)  how to turn this off?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
Dim otlApp As Outlook.Application
    Dim otlNMSpace As Outlook.NameSpace
    Dim otlFolder As Outlook.MAPIFolder
    Dim otlSubFolder As Object
    Dim otlItem As Object
    Dim otlMailItem As Outlook.MailItem
    Dim otlAttachment As Outlook.Attachment
    Dim strFilePrefix As String
    
    Set otlApp = CreateObject("Outlook.Application")
    Set otlNMSpace = otlApp.GetNamespace("mapi")
    Set otlFolder = otlNMSpace.GetDefaultFolder(olFolderInbox)
    If Not otlFolder Is Nothing Then
        For Each otlItem In otlFolder.Items
            If otlItem.Class = olMail Then
                Set otlMailItem = otlItem
                If otlMailItem.Attachments.Count > 0 Then         '  thus only if mail has attachment !!
                    Debug.Print otlMailItem.Subject, otlMailItem.ReceivedTime, otlMailItem.SenderName
                            strFilePrefix = Right$(otlMailItem.Subject, 2)
                            For Each otlAttachment In otlMailItem.Attachments
                                If otlAttachment.FileName = "strPrefix" & "000x.txt" Then
                                    otlAttachment.SaveAsFile "C:\MyFolder\" & strFilePrefix & "\" & otlAttachment.FileName
                                End If
                            Next otlAttachment
                End If
            End If
        Next
    End If
    Set otlApp = Nothing
    Set otlNMSpace = Nothing
    Set otlFolder = Nothing
[+][-]07.09.2008 at 08:52AM PDT, ID: 21965078

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming Languages, Visual Basic Programming, Microsoft Operating Systems
Tags: microsoft, outlook 2003, windows xp, VB6, vb6
Sign Up Now!
Solution Provided By: JonMny
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.10.2008 at 08:06AM PDT, ID: 21974153

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628