View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
donbowyer donbowyer is offline
external usenet poster
 
Posts: 107
Default Importing from Outlook - how to remove the alert.

I use MS Office 2003 on Win XP

The following is the first few lines of code I'm using to import Outlook
contact information.
It works fine, but I get the standard alert dialog box saying that a program
(my Code) is trying to access addresses stored in Outlook. I allow access for
1 minute and all is well, except I don't need the alert.
Trawling the various knowledge bases suggests that if I use the intrinsic
Application object (not NewApplication) I won't get the alert.
Not so with the code below.
Somewhere else suggested a digital signature was the answer.
I have created a SelfCert signature and applied it to this code.
It is recognised and works, but still I get the alert.

Sub ImportPhone()
Dim olApplication As Outlook.Application
Dim olNSpace As Outlook.Namespace
Dim olJournalFolder As Outlook.MAPIFolder
Dim olJournalItem As Outlook.JournalItem
Dim wbBook As Workbook
Dim wsSheet As Worksheet
Dim lnCount As Long, i As Long

Set olApplication = Outlook.Application
Set olNSpace = olApplication.GetNamespace("MAPI")
Set olJournalFolder = olNSpace.GetDefaultFolder(olFolderJournal)
How can I stop it appearing??
--
donwb