Share via

vb.net reference library for ms-access

Anonymous
2016-03-21T15:20:12+00:00

Is there a reference library for vb.net objects in ms-access? I see a number of references to visual studio, but cannot seem to find one that supports vb.net objects.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2016-03-22T13:54:45+00:00

As Tom said, you really can't do that. What you've found is information on how to "wrap" a .NET DLL that YOU have created, and allow it to be used in VBA. You could conceivably create a DLL that includes all the calls to the smtp class, but you'll still find troubles with that (.NET permissions and such may prevent you from doing this).

There are other ways to send emails in Access, like CDO and vbSendMail. Those don't require anything other than an SMTP server, and you can generally do everything you need with them.

If you're only dealing with Outlook, I've found vbMAPI from www.everythingaccess.com to be the best tool to use.

Was this answer helpful?

0 comments No comments

Answer accepted by question author

Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
2016-03-21T18:28:10+00:00

No. Access is a COM based application, and it does not know about .NET. It's a completely different world.

If you want to write .NET code and use it from Access (or any VBA client), you will need to add a "COM wrapper", and then you can use it just fine. I do this all the time, for example when using the .NET encryption libraries, or a .NET web service.

Was this answer helpful?

0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2016-03-23T13:01:55+00:00

    Thanks for the reply. I probably have enough info to resolve this in one of several ways and can close this thread. Some background. (7) years ago VBA code was written to access objects in a third party application Afterlogic/Mailbee for emailing reports via smtp for users who did not have Outlook. No problem at the time because the code supported ADO. Now Google email users have requested that OAuth2 authorization be enabled in the code. The problem is that the class library from Afterlogic/Mailbee only supports .NET.

    So, I think the choices are, 

    1. to see if an executable can be created (in Visual Studio?) and the run it from MS-Access passing the parameters as part of a command line
    2. explore other options, but will need to see if one can be found that supports OAuth2 for Google email users.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-03-22T13:34:36+00:00

    I'm having trouble getting to first base using COM wrappers. I'm trying to use the objects in a .NET class library "mail.smtpmail.smtp" in MS-Access. Without a wrapper, using ADO,

    Dim oSMTP AS Object 

    Set oSMTP = CreateObject("mail.smtpmail.smtp")

    ..produces the error "429 - ActiveX component cannot create the object.

    Can you help jump start me with the direction that I need to go to create a wrapper? Is the wrapper something that needs to be created in Visual Studio? Thanks

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-03-22T12:36:08+00:00

    Thanks. I see msdn has info on COM wrappers. I'll take a look.

    Was this answer helpful?

    0 comments No comments