We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Accessing Document Properties

Thread ID:

Created:

Updated:

Platform:

Replies:

48770 Sep 4,2006 10:53 AM Sep 5,2006 09:58 AM Windows Forms 3
loading
Tags: DocIO
Owen Morgan-Jones
Asked On September 4, 2006 10:53 AM

Hi,

We have been evaluating the Essential DocIO tool and would like to use it to access information stored in Word Document Custom Property fields. Some support for this is clearly present through the use of the WordReader.CustomDocumentProperties collection, but I have been unable to find any documentation of this property''s use.

How would I go about accessing a custom document property called "MyField"? I have tried using reader.CustomDocumentProperties["MyField"], but this throws an exception.

Any help would be much appreciated.

Cheers,

Owen

Administrator [Syncfusion]
Replied On September 4, 2006 03:10 PM

Hi Owen,

Thank you for evaluating Essential DocIO.

I was not able to reproduce the problem. It was working fine for me. You can access the custom properties from document by enumerating through the document.CustomDocumentProperties property and access the custom properties one by one by its index value. Also you can access the custom properties by its name.

I have created a small sample for accessing the document properties from the document. Please take a look at it and let me know if it meets your need.

Here is the code snippet to accessing the custom properties from document.

[C#]

for (int i = 0; i < Document.CustomDocumentProperties.Count; i++ )
{
Cus_Properties.Add( document.CustomDocumentProperties[i].ToString());
}

Thanks,
Prabhu


Accessing_CusProperties.zip

Owen Morgan-Jones
Replied On September 5, 2006 05:57 AM

Hi Prabhu,

Thanks for your swift reply. I tried the code snippet above, but it did not compile, and gave these error messages:

1) The best overloaded method match for ''Syncfusion.DocIO.DLS.CustomDocumentProperties.this[string]'' has some invalid arguments

2) Argument ''1'': cannot convert from ''int'' to ''string''

These were both caused by the line in the body of the for-loop.

This is typical of the problem I am having. I can see in the debugger''s watch that the document properties are held within the CustomDocumentProperties property, but am unable to access them through code, either with an index integer or a the property name as a string.

Regards,

Owen

Administrator [Syncfusion]
Replied On September 5, 2006 09:58 AM

Hi Owen,

Sorry for the inconvenience caused.

This issue was identifided internally and we have been fixed it. The sample was working fine in our latest internal assemblies. Could you please create a Direct – Trac incident by mentioning the forum ID for reference and I will send you the preview version of latest internal assemblies for run this sample.

Thanks,
Prabhu

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;