Custom Mail Form pops up security dialog

  • Thread starter Peter Karlström
  • Start date
P

Peter Karlström

Hi!

We are developing an integrated document storing process between Outlook
clients and different
target systems.
The target systems is databases or FileNet document-system.

We have developed a custom mail form, in wich we placed a button and som
VB-code.
The code that executes when the user presses the button is presented below.

The problem is the security warning that shows when the user clicks the
button.
The people who is going to use this system will save hundreds of mails each
week, and will not
have to push any more buttons than absolutely necessary.

We have tried to publish the form to Organisation and Personal folders with
no difference.

Is there a way around this without installing 3-rd party products that
automaticly clicks the Yes-button?

Thanks in advance for any input on this matter.

Regards
Peter Karlström
Midrange AB
Sweden

CODE FROM CUSTOM FORM
Sub cmdStore_Click()

'Creating the mailitem object connection
Set olApp = CreateObject("Outlook.Application")
Set olItem = OlApp.ActiveInspector.CurrentItem
Set olNameSpace = olApp.GetNameSpace("MAPI")

'save mail-data to som variables
fSendDate = olItem.CreationTime
fReceiveDate = olItem.ReceivedTime
fSubject = olItem.Subject
fBody = olItem.Body
fSender = olItem.SenderName
fSenderMail = GetFromAddress(olItem)
fSendRepl = olItem.ReplyRecipientNames
fMsgID = olItem.EntryID
fFolderID = olItem.Parent.StoreID
fRecievName = olNameSpace.CurrentUser
fuserName = olNameSpace.CurrentUser

'Create string with attachments separated by |
For each olAttach in olItem.Attachments
fAttachList = fAttachList & olAttach.filename & "|"
Next

'Create object-connection to special developed Visual Basic DLL
'The DLL shows a search windows where the user selects place to store
the documents.
set DM = CreateObject("DMail.Store")
resp = DM.DStart(0, 0, fSendDate, fReceiveDate, fSender, fSenderMail,
fSubject, fBody, fAttachList, fMsgID, fFolderID, fRecievName, fuserName)

'Reset used objects
Set olNameSpace = Nothing
Set olItem = Nothing
Set olApp = Nothing
Set DM = Nothing

End Sub

Function GetFromAddress(objMsg)

Set objSession = CreateObject("MAPI.Session")
objSession.Logon "", "", False, False
strEntryID = objMsg.EntryID
strStoreID = objMsg.Parent.StoreID
Set objCDOMsg = objSession.GetMessage(strEntryID, strStoreID)
On Error Resume Next
strAddress = objCDOMsg.Sender.Address
If Err = &H80070005 Then
MsgBox "Säkerhetsinställningarna i Outlook gör att du " & _
"måste svara Ja på frågan om åtkomst till E-postadresser " & _
"för att kunna erhålla avsändarens adress.", vbExclamation, "Hämta
E-postadress"
End If
GetFromAddress = strAddress
Set objCDOMsg = Nothing
objSession.Logoff
Set objSession = Nothing

End Function
 
H

Hollis D. Paul

Is there a way around this without installing 3-rd party products that
automaticly clicks the Yes-button?
Yes. You need to use Redemption objects, which will not trigger the
security warning. The can be found at Dmitry Streblechenko (MVP)'s site,
http://www.dimastr.com/

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Mukilteo, WA USA
 
P

Peter Karlström

Thanks Hollis

I first tried with MAPIProps, but I had problems using it in the form script.

Redemption seems to work just fine.

Regards
Peter Karlström
Midrange AB
Sweden

Hollis D. Paul said:
Is there a way around this without installing 3-rd party products that
automaticly clicks the Yes-button?
Yes. You need to use Redemption objects, which will not trigger the
security warning. The can be found at Dmitry Streblechenko (MVP)'s site,
http://www.dimastr.com/

Hollis D. Paul [MVP - Outlook]
(e-mail address removed)
Mukilteo, WA USA
 

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