rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.92k stars 301 forks source link

Unit Testing - Support All Major Office Applications #112

Closed rubberduck203 closed 8 years ago

rubberduck203 commented 9 years ago

Note: Outlook, Visio and Publisher Application classes don't expose a Run method, which is required for RD unit testing to work.

Instructions for adding support.

  1. Determine the correct ProgId to be passed to Marshal.GetActiveObject.
  2. Implement a new child class of IHostApplication. The name of the application needs to be passed to the base constructor like so.

    public ExcelApp() : base("Excel") { }

    You must also determine the proper way to call to call VBA's Application.Run() method and over ride GenerateFullyQualifiedName accordingly.

  3. Determine the name of the reference and add it to the VBE HostApplication extension method
rubberduck203 commented 9 years ago

Lots of good notes about this on this commit.

rubberduck203 commented 9 years ago

Outlook & Publisher do not support the Application.Run method. There may be workarounds, but I don't think we will pursue them unless the project really catches on and there is a demand for it.

retailcoder commented 9 years ago

Outlook VBA is pretty common, I'd like unit tests to work in Outlook. Then we can disable the Test menu if the host app doesn't support it ;)

Sent from my Samsung mobile

retailcoder commented 9 years ago

This SO question might help. I'm willing to award a +500 bounty to whoever has an answer that translates into RD 2.0 supporting unit tests in Outlook.

retailcoder commented 9 years ago

Outlook will not work. Removing from the check-list.

retailcoder commented 8 years ago

Do we have the MSProject PIAs? Otherwise it looks like we're done here :smile:

rubberduck203 commented 8 years ago

Even if we did, none of us have a copy to test. Closing it. =)

Hosch250 commented 8 years ago

I can get a copy of Project 2010/2013/2016 from DreamSpark for testing purposes. We need a developer with 2007 to install these PIA's and reference the MSProject dll: https://www.microsoft.com/en-us/download/details.aspx?id=18346.

I would do it myself, but I do not have a product key for 2007, and MS took the trial downloads down.