Categories > OpenTBS with DOCX >

Word Document Properties Updating

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Philip
Date: 2014-10-21
Time: 16:30

Word Document Properties Updating

Hi

Is it possible to update the Word Document Properties using TBS? Just to clarify that is a field which is in the word document from "Quick Parts" "Document Properties". When you insert one of these fields, it appears in square brackets like this...
[Company]

if you replace it with TBS code...

[onload.Company_Name]

then the document properties field is set to "[onload.Company_Name]" and is not replaced with the contents of the TBS field. If you insert a content control object it works fine but not when it is a document properties field. I see there is a separate XML file called "docProps\app.xml" which contains the field so I guess this will need updating. I notice there is a separate function for headers and footers so will something similar be required for document properties?

Thanks in advance.
By: Skrol29
Date: 2014-10-23
Time: 22:11

Re: Word Document Properties Updating

Hi Philip,

Some document properties are saved in the "docProps/core.xml" sub-file:
- title
- subject
- creator
- keywords
- description
- lastModifiedBy
- category
- contentStatus

And some other properties are saved in the "docProps/app.xml" sub-file:
- Manager
- Company
- HyperlinkBase

If you've placed an automatic TBS field ([onload] or [onshow]) then you just have to open the sub-file and the TBS field will be merge.

For exemple:
$TBS->PlugIn(OPENTBS_SELECT_FILE, 'docProps/app.xml');
$TBS->PlugIn(OPENTBS_SELECT_FILE, 'docProps/core.xml');
By: Philip
Date: 2014-10-24
Time: 11:09

Re: Word Document Properties Updating

Simple (when you know how)! It works perfectly with either onshow or onload.

Thanks, much appreciated.