Click here to Skip to main content
15,314,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I try to create an new email item with MS Outlook (2016, x64 & on Win11):

VB
Dim appOutlook = CreateObject("Outlook.Application")
Dim appOutlookMsg = appOutlook.CreateItem(0)

The 2nd line fails with error message:
System.MissingMemberException: "Public member 'CreateItem' on type 'Application' not found."


The application itself is complied as x64 and also "CreateObject" opens a MS Outlook instance.
On my business machine both code lines are working (Office 365 BUT x86, Win10)!

Any ideas why it does not work?

What I have tried:

I checked if the member could be exposed (failed as well):
appOutlook.GetType.GetMethods()
It seems that only the members from the application object are accessible and not members from the implemented interface "_application".
I also tried to create an new Excel workwook with LateBinding; failed too.
Posted
Updated 9-Dec-21 15:15pm
Comments
Daniel Leykauf 9-Dec-21 20:36pm
   
I installed also MS Office 2019 (x86) after deinstallation of previous version and got same error message.

1 solution

Ok, I installed VS2019 as well (used previously VS2022 with .net5.0) and now with Framework 4.5 it works ...
I tested also Framework 4.8 and it worked too. So it seems that the issue is with VS2022 & >= .Net5.0

It works with c# and .net5 as well; it is only an iusse with vb code.
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900