Solved

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

Posted on 2011-09-15
6
279 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Trying to use colormap to replace color in png, with a gradient to transparent 7 39
Help with Syntax 9 36
Sql server insert 13 29
VB.Net Tranfer data between to VB.Net apps 8 25
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 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