JimK31
asked on
Managing References via Code
I have a question about the reference library and if anyone has a better approach to my issue that would be great as well.
I have a distributed application that I am adding email functionality too. I have been reading a lot here lately and have downloaded and installed Redemption. So far that seems to be working for me. The issue I have is that a very small number of the people using the .mde application will need to use email so I was wanting to NOT include the Redemption library as a default but rather only install it as needed.
I am assuming that at the very least, the Redemption .dll would need installed but then is there code I can run to add it as a checked Reference?
Thanks for any and all help.
Jim
I have a distributed application that I am adding email functionality too. I have been reading a lot here lately and have downloaded and installed Redemption. So far that seems to be working for me. The issue I have is that a very small number of the people using the .mde application will need to use email so I was wanting to NOT include the Redemption library as a default but rather only install it as needed.
I am assuming that at the very least, the Redemption .dll would need installed but then is there code I can run to add it as a checked Reference?
Thanks for any and all help.
Jim
ASKER
Thanks MX. Can you give me a little more on that. Searching on Collaboration Object seems to return a lot of stuff on Lotus Notes and SendObject commands. The SendObject doesn't seem to be a good choice because Outlook security gets in the way.
I pointed this to someone familiar with CDO.
mx
mx
Jim,
Check out the attached file. This is an MDB app I wrote that uses CDO (collaborative data objects). CDO is a library that comes standard on all windows machines since NT. This app uses late binding so no broken reference headaches, either.
I've written two classes, one that is a wrapper around an email message. The other is a wrapper around an smtp server. You need the address/login info for your SMTP server to use this, btw.
The file I'm sending you is really a ZIP file, not a TXT file (EE won't accept ZIP files here yet). When you download it, rename it from TXT to ZIP
-Mike
cdomail-v2.txt
Check out the attached file. This is an MDB app I wrote that uses CDO (collaborative data objects). CDO is a library that comes standard on all windows machines since NT. This app uses late binding so no broken reference headaches, either.
I've written two classes, one that is a wrapper around an email message. The other is a wrapper around an smtp server. You need the address/login info for your SMTP server to use this, btw.
The file I'm sending you is really a ZIP file, not a TXT file (EE won't accept ZIP files here yet). When you download it, rename it from TXT to ZIP
-Mike
cdomail-v2.txt
ASKER
Thanks Mike. I am in meetings most all day but this afternoon I will get into this. It looks great although it is over my head. I am reasonably good at figuring out how to use others code however.
Can't wait to get into it and will get back with you shortly.
MX: thank you for the contact.
Jim
Can't wait to get into it and will get back with you shortly.
MX: thank you for the contact.
Jim
You are welcome. Mike is the MAN!!
mx
mx
ASKER
Mike,
Well I sure a heck do not understand it, but it sure works well. Thanks.
I will be using this from code and will be emailing multiple people based on query results so I am going to open a recordset that looks a table and emails everyone in that table. Have not got the loop written yet but will start working on it. The thing I have not got to work correctly yet is your code in the module for sending one email.
Public Sub ShortFormExample()
Dim mysvr As clsAESeMailServer
Dim mymsg As clsAESeMailMsg
'Instantiate the objects
Set mysvr = New clsAESeMailServer
Set mymsg = New clsAESeMailMsg
'Call my pseudo constructors to initialize the most common settings
mysvr.Init "<your smtp server>", "<your account>", "<your password>"
mymsg.Init mysvr, "mike@aesworld.com", "mike.aes@gmail.com", "Testing 1.2.3"
mymsg.Send
End Sub
The email arrives but the subject line "Testing 1.2.3" is blank.
Thoughts?
Jim
Well I sure a heck do not understand it, but it sure works well. Thanks.
I will be using this from code and will be emailing multiple people based on query results so I am going to open a recordset that looks a table and emails everyone in that table. Have not got the loop written yet but will start working on it. The thing I have not got to work correctly yet is your code in the module for sending one email.
Public Sub ShortFormExample()
Dim mysvr As clsAESeMailServer
Dim mymsg As clsAESeMailMsg
'Instantiate the objects
Set mysvr = New clsAESeMailServer
Set mymsg = New clsAESeMailMsg
'Call my pseudo constructors to initialize the most common settings
mysvr.Init "<your smtp server>", "<your account>", "<your password>"
mymsg.Init mysvr, "mike@aesworld.com", "mike.aes@gmail.com", "Testing 1.2.3"
mymsg.Send
End Sub
The email arrives but the subject line "Testing 1.2.3" is blank.
Thoughts?
Jim
ASKER
Getting back to my original question, anyone have the code to install a new reference library by code?
The CDO approach looks good but really only seems to work for internal email. Exchange will not relay the mail if it is external.
The CDO approach looks good but really only seems to work for internal email. Exchange will not relay the mail if it is external.
ASKER
No one knows if you can or can not add a reference library item via code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
mx