Add a reference to a Word Document Project

Posted on 2010-01-04
Last Modified: 2013-11-10
I have created a Word Document Project that creates a word document based on the content of some tables.  All I need to do is set an ID number via a property or constructor before the docuement loads.
This works fine but I want to be able to call this document from my main application.  I have tried creating a refence to the the project but cannot access any constructors or properties.

Question by:Kevin Robinson
    LVL 42

    Expert Comment

    can u post the code u already implemented just to get an idea?
    LVL 3

    Author Comment

    by:Kevin Robinson
    Basically I have two projects.   One is the Word Document VSTO project the other is a Windows forms project.  I need to be able to open up the word document from the windows form project by passing a parameter in the same way I would another refereneced project.  

    The problem is that first of all you cannot create a project reference to a word project and if you create a file reference to the word docuement you cannot get access to the constructors or any paramters.  So I have do way as yet to pass a parameter from one to another.

    I dont think I really need to post any code as it would only confuse things.  
    LVL 35

    Accepted Solution

    I do not think you can call your WORD VSTO project from a win form.
    The reason is that VSTO solutions are designed to be hosted by an Office application (in this case Word)

    If you really need this functionality I will suggest to build a library dll will all your business rules and Word interaction so that they are used for both your VSTO project and your Win form class. Remember that VSTO is a smart wrapper of the Office PIA.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now