Solved

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

Posted on 2011-09-15
6
281 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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