cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use document properties inside the document

SOLVED
Highlighted

How to use document properties inside the document

I want to use the document properties (author and title) and the file name of the Document and some custom defined properties to show them at the header of the document

(I want to use an embedded excelsheet to show the properties formated) and at the head line of each page.

At this time, I put a VBA script-object in the document, which reads the data using

Set metadata = worksheet.metadata

Set items = metadata.customitems

For each item in items

...

If (item.name = "m_discription") Then
Outputs(1).Value = item.value

End If

...

Next

(I'm not familiar with VBA, I found this code lines in a forum)

It works.

My questions:

-Is there another solution for referencing the meta-data inside the doc and inside the header and footer?

(As in Word, for example?)

-How can I get ,title' and ,author' from the builtin document properties and the filename?

Thanks,

H.Steffen

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How to use document properties inside the document

At this time, I put a VBA script-object in the document, which reads the data using

As a minor technical point, it's not VBA, it's VBscript.

-Is there another solution for referencing the meta-data inside the doc and inside the header and footer?

(As in Word, for example?)

No. The only way to do this is via a VBscript.

-How can I get ,title' and ,author' from the builtin document properties and the filename?

Here's a function based on a scripted component that will get any metadata item. To get the filename requires another function based on a scripted component.

View solution in original post

17 REPLIES 17
Highlighted

Re: How to use document properties inside the document

At this time, I put a VBA script-object in the document, which reads the data using

As a minor technical point, it's not VBA, it's VBscript.

-Is there another solution for referencing the meta-data inside the doc and inside the header and footer?

(As in Word, for example?)

No. The only way to do this is via a VBscript.

-How can I get ,title' and ,author' from the builtin document properties and the filename?

Here's a function based on a scripted component that will get any metadata item. To get the filename requires another function based on a scripted component.

View solution in original post

Highlighted

Re: How to use document properties inside the document

Nice worksheet.

Are you planning on putting your scripted components in the FAQ document?

Mike

Highlighted

Re: How to use document properties inside the document

Are you planning on putting your scripted components in the FAQ document?

Yes, I agree that shod be one of the linked documents. A ot of the components that people ask for are already in that document.

Highlighted

Re: How to use document properties inside the document

Holger Steffen wrote:

I want to use the document properties (author and title) and the file name of the Document and some custom defined properties to show them at the header of the document

(I want to use an embedded excelsheet to show the properties formated) and at the head line of each page.

At this time, I put a VBA script-object in the document, which reads the data using

Set metadata = worksheet.metadata

Set items = metadata.customitems

For each item in items

...

If (item.name = "m_discription") Then
Outputs(1).Value = item.value

End If

...

Next

(I'm not familiar with VBA, I found this code lines in a forum)

It works.

My questions:

-Is there another solution for referencing the meta-data inside the doc and inside the header and footer?

(As in Word, for example?)

-How can I get ,title' and ,author' from the builtin document properties and the filename?

Thanks,

H.Steffen

You can't insert a Header (View/Header/footer) and insert file information in them? Version 11 allows this.

Highlighted

Re: How to use document properties inside the document

You can't insert a Header (View/Header/footer) and insert file information in them? Version 11 allows this.

I had forgotten you can get the filename and path directly in the header. But in versions 12 and later, no, they did not add the capability of directly accessing the metadata.

Highlighted

Re: How to use document properties inside the document

Richard Jackson wrote:

You can't insert a Header (View/Header/footer) and insert file information in them? Version 11 allows this.

I had forgotten you can get the filename and path directly in the header. But in versions 12 and later, no, they did not add the capability of directly accessing the metadata.

Created in version 14, printed to pdf file for discussion.

Highlighted

Re: How to use document properties inside the document

But you can't get the meta data, such as Company, Author, etc, so easily.

Highlighted

Re: How to use document properties inside the document

How have you managed to do that Fred?

Mike

Highlighted

Re: How to use document properties inside the document

Mathcad (v14at least)can create headeers and footers almost like Word. From the View menu select header and footer, and get a window segmented inot three sections with buttons to input file, date, path, images, etc.

Highlighted

Re: How to use document properties inside the document

Cheers Fred,

I haven't ever tried inserting the file path and name. The only problem is the Mathcad extension at the end of the file name.

An example of a calc number we use is 20000-CAL-DENG-001, but we don't have xmcd on the end.

Mike

Highlighted

Re: How to use document properties inside the document

Thank you very much.

I will implement that code next time i my form!

Highlighted

Re: How to use document properties inside the document

If you are looking for scripted components similar to the examples posted here try searching for Extra Components, created by Richard, also Phillip Oakley created a good sheet with many useful functions.

Mike

Highlighted

Re: How to use document properties inside the document

I have found them see attached, worth filing.

Mike

Highlighted

Re: How to use document properties inside the document

Thank you, I will do (not now, to much work ...;-)

I will there also look for my 2nd problem:

Putting in the Date of Printing automatically!

Highlighted

Re: How to use document properties inside the document

The attached is an extract from Richards worksheet, which shows the current date and time.

Mike

Highlighted

Re: How to use document properties inside the document

Oh another example which has a calendar and also shows the current date as a string.

Mike

Highlighted

Re: How to use document properties inside the document

Thank you!

Announcements