• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

Outlook / VB.net A program is trying to access e-mail addresses.

Hello all

I have created a code where i extract my contact list from Microsoft Outlook 2007 with vb.net.

Everything is working gret but only for one thing that is not.

Everytime that i open this code, in outlook, i have a message where it tells me that A program is trying to access e-mail addresses.

Is there a way to ALLOW it automatically for this vb.net project?

Thanks again for your help



  Dim intRowNum As Integer

        Dim objXL As Excel.Application
        Dim objWkb As Excel.Workbook
        Dim objSht As Excel.Worksheet


        Dim oApp As Outlook.Application = New Outlook.Application()
        Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
        oNS.Logon("Outlook", Missing.Value, False, True) ' TODO:

        Dim cContacts As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)
        Dim oItems As Outlook.Items = cContacts.Items


        

        '--- set a reference to Excel
        objXL = New Excel.Application
        '--- create the workbook
        objWkb = objXL.Workbooks.Add
        '--- set a reference to the sheet
        objSht = objWkb.ActiveSheet


        'Write Column Headings
        objSht.Cells(1, 1) = "Nom du Client"
        objSht.Cells(1, 2) = "Adresse"
        objSht.Cells(1, 3) = "Ville"
        objSht.Cells(1, 4) = "Code Postal"
        objSht.Cells(1, 5) = "Téléphone"
        objSht.Cells(1, 6) = "Cellulaire"
        objSht.Cells(1, 7) = "Courriel"


        objSht.Range("A1").Select()


        objSht.Cells(1, 1).Font.Bold = True
        objSht.Cells(1, 1).Font.Underline = True

        objSht.Cells(1, 2).Font.Bold = True
        objSht.Cells(1, 2).Font.Underline = True

        objSht.Cells(1, 3).Font.Bold = True
        objSht.Cells(1, 3).Font.Underline = True

        objSht.Cells(1, 4).Font.Bold = True
        objSht.Cells(1, 4).Font.Underline = True

        objSht.Cells(1, 5).Font.Bold = True
        objSht.Cells(1, 5).Font.Underline = True

        objSht.Cells(1, 6).Font.Bold = True
        objSht.Cells(1, 6).Font.Underline = True

        objSht.Cells(1, 7).Font.Bold = True
        objSht.Cells(1, 7).Font.Underline = True

        intRowNum = 2

        For Each oItem In oItems
            objSht.Cells(intRowNum, 1) = oItem.FullName
            objSht.Cells(intRowNum, 2) = oItem.HomeAddressStreet
            objSht.Cells(intRowNum, 3) = oItem.HomeAddressCity
            objSht.Cells(intRowNum, 4) = oItem.HomeAddressPostalCode
            objSht.Cells(intRowNum, 5) = oItem.HomeTelephoneNumber
            objSht.Cells(intRowNum, 6) = oItem.MobileTelephoneNumber
            objSht.Cells(intRowNum, 7) = oItem.Email1Address

            intRowNum = intRowNum + 1
        Next oItem


        
        Dim strDate As String

        strDate = Format(Now, "yyyy-mm-dd_hhmm")

        objSht.SaveAs("C:\Users\Jean-Marc\Desktop\Sauvegarde des contacts" & " - " & strDate & ".xls")
        objXL.Quit()

        MsgBox("Sauvegarde des contact Microsoft Outlook terminé")

Open in new window

Outlook2007-prompt1.png
0
Wilder1626
Asked:
Wilder1626
  • 3
  • 3
1 Solution
 
Jacques Bourgeois (James Burger)Commented:
I do not get this message.

The icon in the message you receive looks a security icon, but it is not one that comes from Windows. I suspect that your anti-virus is blocking the access. Check your anti-virus checkings and/or its documentation to see how to correct that.

If you allow access, do you have something such as "Always" or "This program is secure" in the drop down list?

If I am right and if the application is to be used on many computers that use the same antivirus program, you will have to do the same on all of them.
0
 
Wilder1626Author Commented:
Hello JamesBurger

My Anti-Virus is off for now. But i still get that box. It look's like windows security or outlook security.

In the ALLOW access for option, i only only have from 1 minutes to 15 minutes. i dont have the Always option.

I will look at the Outlook security option, see if i found something.
0
 
Jacques Bourgeois (James Burger)Commented:
I have never seen an icon like the one you get from Windows or Outlook. Similar ones yes, but like this one no.

The icon is fuzzy. Unless it is an artefact of the .png, it does not look like something that would come from Microsoft.

If you click the Help button in the MessageBox, where does it leads to?
0
Industry Leaders: 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!

 
Jacques Bourgeois (James Burger)Commented:
Oups. Sent the last one too fast, hit the wrong button while I was searching for extra info.

Still puzzled about the fuzzy icon, but this message could indeed be sent by Outlook. See here.
0
 
Wilder1626Author Commented:
Do you know what?

I have put back the antivirus and i also did an update and i don't see the icon.

Everything is ok now.
0
 
Wilder1626Author Commented:
Thanks again, everything works now.

It was a anti-virus update to do.

Thanks again.
0

Featured Post

Technology Partners: 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!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now