rvbaoutlookcomrdcomclient

Full list of methods for COM objects


I would like to know which functions I can use with RDCOMClient objects.

For example, to create an email we can use

OutApp <- COMCreate("Outlook.Application")
# create an email 
outMail = OutApp$CreateItem(0)

Along with outMail[["subject"]], outMail[["HTMLbody"]] or outMail[["Attachments"]]$Add(filepath)

But how can I get a comprehensive list?

The RDCOMClient doc is out-of date and the functions listed such as getFuncs() and getElements() are not available in the package anymore. Using names() to try and find out what was under the hood gave me no result, and

install.packages("remotes")
remotes::install_github("omegahat/SWinTypeLibs")

gives an error as well. Any idea on how to check Outlook for objects?


Solution

  • If you have Outlook, Excel or Word installed then you can do the following ...

    1. Press F11 to get to a Visual Basic Application (VBA) Integrated Development Environment (IDE).
    2. On the menu bar go to Tools->References to prompt the References dialog box.
    3. On the References dialog box, in the Available References checkbox list, page down until you find Microsoft Outlook Library (or similar), once found then check the checkbox and then press OK to confirm selection and dismiss dialog. This adds a reference to the Outlook type library to the current project.
    4. With the Outlook type library referenced (see step (3)) one can now press F2 to show the Object Browser dialog box.
    5. In the Object Browser dialog box, select the top left dropdown list which will probably say <All Libraries> . Change the dropdown so it says Outlook, this will scope the object browser to just the Outlook type library.
    6. You can now browse all the objects in the Outlook type library. Select a class in the Classes pane on the left hand side and the class's methods will appear in the right hand side.

    Enjoy!