Word Add-In CustomDocumentProperties

F

Flemming

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
 
F

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top