A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

a program is trying to access e-mail address - how do I avoid this



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 3rd 06, 11:48 PM posted to microsoft.public.outlook.program_vba
marie
external usenet poster
 
Posts: 2
Default a program is trying to access e-mail address - how do I avoid this

In my vba code I'm receiving the following error "a program is trying
to access e-mail addresses you have stored in outlook. Do you want to
allow this?..." I'm not accessing addresses at all so I don't know why
the error message is appearing. I've been able to isolate the error to
the final line of code below where I'm appending text - does anyone
know how I can avoid this msg from appearing??



Sub test()
Dim myOlApp As New Outlook.Application

'check if this is a mail object first
If myOlApp.ActiveInspector.CurrentItem.Class = olMail Then
myOlApp.ActiveInspector.CurrentItem.Subject = "test"

'append to email body
myOlApp.ActiveInspector.CurrentItem.Body =
myOlApp.ActiveInspector.CurrentItem.Body & " appending new text"

End If
End Sub

  #2  
Old August 4th 06, 05:00 AM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default a program is trying to access e-mail address - how do I avoid this

The Body property is also subject to the "object model guard." See http://www.outlookcode.com/d/sec.htm for your options.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"marie" wrote in message oups.com...
In my vba code I'm receiving the following error "a program is trying
to access e-mail addresses you have stored in outlook. Do you want to
allow this?..." I'm not accessing addresses at all so I don't know why
the error message is appearing. I've been able to isolate the error to
the final line of code below where I'm appending text - does anyone
know how I can avoid this msg from appearing??



Sub test()
Dim myOlApp As New Outlook.Application

'check if this is a mail object first
If myOlApp.ActiveInspector.CurrentItem.Class = olMail Then
myOlApp.ActiveInspector.CurrentItem.Subject = "test"

'append to email body
myOlApp.ActiveInspector.CurrentItem.Body =
myOlApp.ActiveInspector.CurrentItem.Body & " appending new text"

End If
End Sub

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A program is trying to access your address Book whylite Outlook - Using Forms 4 July 13th 06 03:05 AM
Unwanted Message pop-up about program trying to access address K.N. Oll Outlook and VBA 0 May 19th 06 01:20 AM
Error Message- Program trying to access email address Andre Outlook - Installation 2 May 12th 06 02:20 AM
how to access mail from different address The Gordons Outlook Express 1 May 1st 06 06:52 PM
program trying to access email addresses Joy Waggoner Outlook - General Queries 2 March 16th 06 11:59 PM


All times are GMT +1. The time now is 08:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.