outlook security manager making own dll

Add-in Express™ Support Service
That's what is more important than anything else

outlook security manager making own dll
 
william steeley




Posts: 11
Joined: 2011-11-11
Hi we currently have a dll which we call from office apps to auto send emails since we have now moved away to a hosted service we always get the security prompt so have bought your software.

i have the software working in .net but need to get it working on vb 6 as a .net dll wont work with office 2003

ive added reference to the secman.dll and have the following code

Set MailItem = myolApp.CreateItem(0)

Call outlooksecuritymanager1.ConnectTo(myolApp)
outlooksecuritymanager1.DisableOOMWarnings = True

On Error GoTo MailError
If Not IsNull(MsgSubj) Then MailItem.Subject = MsgSubj
If Not IsNull(MsgText) Then MailItem.Body = MsgText
If Not IsNull(MsgRecip) Then MailItem.to = MsgRecip

Text_Pos = 0
While Text_Pos < Len(Trim(MsgAttach))
If InStr(Text_Pos + 1, MsgAttach, ";") = 0 And Text_Pos = 0 Then
Email_add = MsgAttach
Text_Pos = Len(Trim(MsgAttach))
Else
If InStr(Text_Pos + 1, MsgAttach, ";") > 0 Then _
Address_Len = InStr(Text_Pos + 1, MsgAttach, ";") - (Text_Pos + 1) Else _
Address_Len = 100
Email_add = Trim(Mid(MsgAttach, Text_Pos + 1, Address_Len))
Text_Pos = Text_Pos + Address_Len + 1
End If
If Len(Dir(Email_add)) > 0 Then MailItem.Attachments.Add (Email_add)
Wend
If MsgDisp = True Then
MailError:
MailItem.Display
Else
MailItem.Send
End If

Set MailItem = Nothing
Set myolApp = Nothing
outlooksecuritymanager1.DisableOOMWarnings = False

what am i doing wrong thanks

Will
Posted 11 Nov, 2011 06:55:01 Top
Renat Tlebaldziyeu


Guest


Hi William,

Please try to replace the following line in your code:
Call outlooksecuritymanager1.ConnectTo(myolApp)

with
Call outlooksecuritymanager1.ConnectTo(myolApp.Application)


Did it help?
Posted 11 Nov, 2011 08:03:31 Top
william steeley




Posts: 11
Joined: 2011-11-11
no didnt tring this


Dim SecurityManager As New secmanLib.OutlookSecurityManager

myolApp = CreateObject("Outlook.Application")


SecurityManager.Connect (myolApp)
SecurityManager.Switch OUTLOOK_APi ,OFF as

but then i get stuck
Posted 11 Nov, 2011 08:14:25 Top
Renat Tlebaldziyeu


Guest


Please note that you should use the ActiveX edition of Security Manager if you develop a VB6 project. Which edition of Security Manager do you currently use?
Posted 11 Nov, 2011 08:20:17 Top
william steeley




Posts: 11
Joined: 2011-11-11
latest version how do you reference the activex one
thanks
Posted 11 Nov, 2011 09:17:08 Top
Renat Tlebaldziyeu


Guest


Here is the sample VB6 code:
Dim OutlookApp As Object
Set OutlookApp = CreateObject("Outlook.Application")
    
Dim SecurityManager As Object
Set SecurityManager = CreateObject("AddInExpress.OutlookSecurityManager")
    
Dim OutlookNameSpace As Object
Set OutlookNameSpace = OutlookApp.GetNamespace("MAPI")
    
Call SecurityManager.ConnectTo(OutlookApp)
    
SecurityManager.DisableOOMWarnings = True
    
Dim OutlookFolder As Object
Set OutlookFolder = OutlookNameSpace.GetDefaultFolder(6)
    
Dim OutlookMailItem As Object
Set OutlookMailItem = OutlookFolder.Items.GetFirst()
    
MsgBox (OutlookMailItem.SenderEmailAddress)
    
SecurityManager.DisableOOMWarnings = False
    
Set OutlookMailItem = Nothing
Set OutlookFolder = Nothing
Call OutlookNameSpace.Logoff
Set OutlookNameSpace = Nothing
    
Call SecurityManager.Disconnect(OutlookApp.Application)
Set SecurityManager = Nothing
    Set OutlookApp = Nothing

Does it work on your PC without security warnings?
Posted 11 Nov, 2011 09:23:04 Top
william steeley




Posts: 11
Joined: 2011-11-11
hi im assuming i add reference to the active x secman.dll

its run ok with no error but not worked ill have a look at the code again
Posted 11 Nov, 2011 09:41:17 Top
william steeley




Posts: 11
Joined: 2011-11-11
all fixed and working many thanks just need to test on a roll out
Posted 11 Nov, 2011 11:07:03 Top
william steeley




Posts: 11
Joined: 2011-11-11
Hi runs great on my machine but doesnt run on another users pc, i have regsvr32 the dll ive made and it find that but comes up with a activex error ive regsvr32 the secman.dll and made no difference any ideas

thanks for the help

William
Posted 11 Nov, 2011 11:51:55 Top
Renat Tlebaldziyeu


Guest


Hi William,

Please note that you should include our redistributable libraries into your setup package, which you install on end-users' machines and register it. If you use ActiveX edition you should deploy and register the following dlls on the target PC with Outlook 32-bit:
- osmax.ocx
- secman.dll

and with Outlook 2010 62-bit:
- osmax64.ocx
- secman64.dll

For information about Outlook Security Manager 2010 deployment, please visit out blog:
http://www.add-in-express.com/creating-addins-blog/cat/outlook-security-manager/
Posted 14 Nov, 2011 00:33:55 Top