Sunday, January 04, 2009

How to Insert Document Properties in Word Document

Update Document Properties in a Word document using Field codes

Field codes are the best tool for any Word users. They are rich source of predefined information that can be inserted in the document.

Word document contains many important properties, which can be accessed from the Properties dialog box.

To view the Properties dialog box, click the Microsoft Office Button , point to Prepare, and click Properties, click Document Properties, and then click Advanced Properties.

The following windows shows the properties




Word Document Properties

Word Advanced Properties

To insert a field select the QuickParts option from Insert tab and then DocProperty in the option
To select a property, click the property name in the Property box in the Field dialog box.

Word Quick Parts Dialog

To view the Field dialog box, on the Insert tab, in the Text group, click Quick Parts, and then click Field.


Insert DocProperty in Word Document

How to insert the DocumentProperties field using Word VBA

The same can be done through VBA as follows

Sub Insert_PropertyData_InDocument()

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"DOCPROPERTY CreateTime ", PreserveFormatting:=True

End Sub


Word DocProperty Field
















7 comments:

  1. Anonymous11:23 PM

    COOL!!! )))
    Thank you!

    ReplyDelete
  2. Anonymous10:51 PM

    Hello. And Bye.

    ReplyDelete
  3. Why is Advanced Properties greyed out in my Excel 2007 ?>>>

    ReplyDelete
  4. Anonymous6:32 PM

    Eh is there a way to edit total editing time property?

    ReplyDelete
  5. Anonymous1:41 PM

    Saving the document with a new file name will reset the total editing time.

    ReplyDelete
  6. Anonymous12:09 AM

    word quick parts document property displays html markup for the rich text field

    ReplyDelete
  7. Anonymous12:09 AM

    Problem scenario. :

    http://community.office365.com/en-us/f/153/p/55931/201955.aspx#201955

    ReplyDelete

StumbleUpon
Share on Facebook
Related Posts Plugin for WordPress, Blogger...

Visual Basic for Applications (VBA) Forum (recent threads)

CodeKeep VBA Feed

Visual Studio Tools for Office Forum (recent threads)

Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.

Office Business Applications (OBA) Team Blog

MSDN Code Gallery Published Resources For Tag VSTO

microsoft.public.vsnet.vstools.office Google Group