Appointment Form Customization - Error

R

Rob

I've hid both the Appointment and Availability Tabs on the
Appointment form to use in the Calendar environment.
However, after all has been said and done, when I open my
custom form I get a message stating that the custom form
is trying to access email addresses?? I have to clear
this message every time I open a new form. It is getting
to be a real bother. Any way I can disable this?

Thanks,
 
R

Rob

I've got the following code behind the 'Open' form event
and it's essentially for getting the users login id only.
I copied this code from another application and perhaps I
have too much? Can you help identify the unnecessary
code? I.e. not related to just getting the userid?

'This section of code is to get a UserId
'Get data from Session.CurrentUser.
Dim cdoSession 'As MAPI.Session
Dim cdoAddrEntry 'As AddressEntry
Dim strData 'as string
Dim strUserid 'as string

'Define them explicitly or use their value.
dim cdoPR_Account
dim cdoPR_EntryID
Dim vbCRLF

cdoPR_Account = &h3a00001e
cdoPR_EntryID = &h0fff0102
vbCRLF = chr(13) & chr(10)

on error resume next

'Start the CDO code to find a match.
Set cdoSession = CreateObject("Mapi.session")
cdoSession.Logon ,,false,false,0 'Use the existing
Outlook session.
if err.number <> 0 then msgbox "ERROR in logon: " &
err.number & vbCRLF & err.description

'Get the AddressEntry of the recipient/current user.
Set cdoAddrEntry = cdoSession.CurrentUser
'if err.number <> 0 then msgbox "ERROR getting
AddressEntry: " & err.number & vbCRLF & err.description

'Get properties.
strUserid = cdoAddrEntry.fields(cdoPR_Account)
objUserid.value = strUserid
objAuditUserid.value = strUserid
objVacUserid.value = strUserid
objTrdUserid.value = strUserid
objTrdAuditUserid.value = strUserid

'Explicitly release objects.
cdoSession.logoff
'Set cdoAddrEntry = Nothing
Set cdoSession = Nothing
-----Original Message-----
What code do you have behind the form's Open or Read
events? In the meantime, see
http://www.slipstick.com/outlook/esecup.htm#autosec
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers



"Rob" <[email protected]> wrote in
message news:[email protected]...
 
S

Sue Mosher [MVP]

There is no way to avoid a security prompt unless the Exchange administrator has suppressed them, because Session.CurrentUser is a protected object.

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top