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
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