index > Visual Studio Tools for Office > Geting name of a Custom property

Geting name of a Custom property

Hi,

I want to get the name of a custom property.

I know that you can get number of custom properties in a document by using following code, but how can i get the name of them?

AllCustomProps = this.WordApplication.ActiveDocument.CustomDocumentProperties;

Type TypeOfAllCustomProps = AllCustomProps.GetType();

int NumberOfProperties = Int32.Parse(TypeOfAllCustomProps.InvokeMember("Count",

BindingFlags.Default | BindingFlags.GetProperty,

null, AllCustomProps, new object[] { }).ToString());

Medes_

You need to query the .Name property of an individual CustomDocumentProperty. This article demonstrates how to get the "Value" property, just substitute "Name", use an integer index (instead of a string) and you should get there...

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q303296




-- Cindy Meister (Word MVP)
Cindy Meister
reply 2

You can use google to search for other answers

 

More Articles

• Help on exporting data from C# 2005 to an excel worksheet
• access [contextual||context||right-click] [menu||commandbar] of c...
• A newbie question: how to control word directly?
• Mail item icons
• Office10 directory and weirdness
• Visual Basic 2005 and MSWord Rule Bar
• PPT SlidShow by Form
• i need help creating a macro for a button
• Outlook 2003: catch right-click over a mail item in explorer view
• Unable to invoke BCM(Outlook) events.
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Visual Studio For Applications IDE Hunt
• Again: Error HRESULT E_FAIL has been ret
• Problem deleting excel sheets
• Capturing Out of office event in Outlook
• Inserting standard comments into Word
• Why do I have multiple instances of Trin
• how to dynamically build table
• ThisApplication_Startup - can't stop at
• How can I add a CommandBarButton to &quo
• Word2007 Add-In: Can I customize the Wor
• OPENING A TEMPLATE IN WORD 97
• Can't update MS Access with C++
• How to Create Outlook ContactItem in Fol
• Seperate data and design-style in Excel
• check to see if the sent mail is a reply

Hot Articles

• problem with deploying VSTO applications
• Runtime Library
• Outlook Add-In hand-on lab???
• data from query result to excel graph/ch
• How to start and stop Excel from WinForm
• Document information panel (Infopath)
• How to apply WordML.xslt to DataOnly.xml
• OLK 2003. Catch the Move mailItem event
• Dynamic Controls Within An Outlook 2007
• BeforeDelete event of XMLNode in Word, D
• RPC Server unavailable when opening new
• Prevent Smart Tag deletion ?
• App Manifest > Deployment Manifest Qu
• is there a "link pressed" even
• ActionsPane And The Disappearance Act (W

Recommend Articles

• Inserting standard comments into Word
• VSTO Excel Binding a dataset from a webe
• VSTO "v3" - Compatibility, Sec
• OutlookAddin
• infoPath forms problem
• Do you have to have Office installed?
• How to 'translate' a Dataset into a Tabl
• strange error using serverdocument
• create an excel workbook
• Unable to connect to the Remote oracle d
• Customization assembly could not be load
• VSTO 3.0 and Vista Beta 2?
• argument display and description for Use
• Microsoft.vbe.interop.dll
• Upgrade "path" for end-users w