Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
developer
active.documents
automation
binary.file_format
clipboard.dde
com.add_ins
hosting.controls
internet_other
office.sdks
officedev
officedev.other
outlook.forms
outlook.vba
smarttags
vba
web.components
  
 
date: Fri, 16 May 2008 08:02:30 +0200,    group: microsoft.public.office.developer.com.add_ins        back       


Word Add-In CustomDocumentProperties   
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
date: Fri, 16 May 2008 08:02:30 +0200   author:   Flemming

Re: Word Add-In CustomDocumentProperties   
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
>
date: Fri, 16 May 2008 21:13:45 +0200   author:   Flemming

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us