Hi all, I'm creating a Word Add-In using VS2008 and VSTO. I'm trying to read the CustomDocumentProperties like this Dim objWordAppl As Word.Application = Globals.ThisAddIn.Application Dim objWordDoc As Word.Document Dim objCustomProps As Object objWordDoc = objWordAppl.ActiveDocument objCustomProps = objWordDoc.CustomDocumentProperties() MsgBox(objCustomProps("TestProp")) When I run this it stops with a error, and I can't seem to find out why... If I get something return it's like "System.__ComObject" Can you tell me what I'm doing wrong, then I'll be happy to know. Thanks for time, Flemming
Closed - eventhoug CustomDocumentProperties does not have any properties like .Value or anything... then all my code work if I just add .Value like this MsgBox(objCustomProps("TestProp").Value) Strange.. Flemming "Flemming" wrote in message news:eZEZupxtIHA.1936@TK2MSFTNGP04.phx.gbl... > Hi all, > > I'm creating a Word Add-In using VS2008 and VSTO. I'm trying to read the > CustomDocumentProperties like this > > Dim objWordAppl As Word.Application = Globals.ThisAddIn.Application > Dim objWordDoc As Word.Document > Dim objCustomProps As Object > > objWordDoc = objWordAppl.ActiveDocument > objCustomProps = objWordDoc.CustomDocumentProperties() > MsgBox(objCustomProps("TestProp")) > > > When I run this it stops with a error, and I can't seem to find out why... > > If I get something return it's like "System.__ComObject" > > Can you tell me what I'm doing wrong, then I'll be happy to know. > > Thanks for time, > Flemming >