Solved

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

Posted on 2011-09-15
6
275 Views
Last Modified: 2012-05-12
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
Comment
Question by:Wilder1626
  • 3
  • 3
6 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 36544413
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
 
LVL 11

Author Comment

by:Wilder1626
ID: 36544584
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
 
LVL 40
ID: 36544790
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 40
ID: 36544826
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
 
LVL 11

Author Comment

by:Wilder1626
ID: 36545225
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
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 36546533
Thanks again, everything works now.

It was a anti-virus update to do.

Thanks again.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

759 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now