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.

update the value of the custom document property field

Thread ID:

Created:

Updated:

Platform:

Replies:

77083 Oct 13,2008 06:05 AM Nov 10,2008 06:17 AM ASP.NET Web Forms (Classic) 3
loading
Tags: DocIO
Administrator [Syncfusion]
Asked On October 13, 2008 06:05 AM

I have added custom document properties to my doc like this:

document.CustomDocumentProperties.Add("CUSTOM_PROPERTY", "VALUE")

Then later, I append the field to paragraph:

paragraph.AppendField("CUSTOM_PROPERTY", FieldType.FieldDocProperty)

My question is, how to perform an "update field"? How do I get the appended field to print the actual value of custom property instead of the name. I can do it in Word by clicking the field with right mouse button and selecting "update field" from context menu.


Bhuvaneswari P [Syncfusion]
Replied On October 15, 2008 03:07 AM

Hi Vesa,

Thank you for your interest in Syncfusion products.

The fields can't be updated by DocIO, it should be updated only after opened in MS word and by pressing F9 or select the fields and by giving update field. Since these fields values can''t be set during document creation. The fields are only updated after opened by MS word.

As a workaround please use create one macro like give below in any of your word document. This will automatically updates when ever any documents opened. The AutoOpen macro automatically runs when the document opens.

Sub AutoOpen()
Dim aStory As Range
Dim aField As Field
For Each aStory In ActiveDocument.StoryRanges
For Each aField In aStory.Fields
aField.Update
Next aField
Next aStory
End Sub

Here is the link more about automatically updates fields

http://support.microsoft.com/kb/212703/


Please let me know if you have any questions.

Best Regards,
Bhuvana



Administrator [Syncfusion]
Replied On October 15, 2008 04:57 AM

Thank you for a quick reply. This was exactly the answer I needed and will work for me like a charm.


Bhuvaneswari P [Syncfusion]
Replied On November 10, 2008 06:17 AM

Hi Vesa,

Thanks for the update.

Glad to know that it’s meets your requirement.

Best Regards,
Bhuvana



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.

;