Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I get a com addin to talk to a .NET form

Status
Not open for further replies.

MILLER09

IS-IT--Management
Nov 19, 2003
9
AU
i've created a COM addin for several office applications (word,excel,ppt) and have put a commandbarbutton into each. Clicking this button calls a form. This form acts as a user interface to the current documents document properties so that the user only need click onto menuitems in several context menu boxes, selected a couple of keywords and they are set as properties (builtin and custom) for that document. The only problem is that I keep getting an object reference not set. I just don't know how to pass the document type detected in the com addin to the form! e.g.
if typeof (application) is word.application then
dim docType as word.document
wordApp = CType(application, word.application)
excelApp = nothing
pptApp = nothing
else if ...

The form uses
oCustomProperties = docType.BuiltInDocumentProperties
etc. to get anything useful done so the addin needs to pass the docType to the form ByVal. I just don't know how to do this. Please help!

Eternally indebted,

neuralSea
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top