Can I show the docproperties of a document next to it's hyperlink.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a kind of index document that has hyperlinks to a whole bunch
of other documents spread around the server to make them easier to find. I
want to put a field next to each hyperlink that will show the 'docproperties
lastsavedtime' for the file that the link relates to. Is it possible or does
docproperties only display the info for the current document?
 
Yes, DocProperties applies only to the current document. You'd need a macro
to do what you describe.
 
I'm scared of Macro's - any pointers on how to write a macro that would
achieve what i'm after?

Thanks
 
Retrieving the properties from another document is easy enough. The
challenges here are

a) what triggers the macro - how often do you want to refresh the properties
from the source documents?
b) which properties do you want? - there are dozens of built-ins, and for
any given document the set of custom properties is open-ended
c) what do you want to do with the retrieved values?


To give you a taste of it, paste this into a code module and run it


Public Sub XYZ()

Dim pProp As Office.DocumentProperty
Dim pDoc As Word.Document

Set pDoc = Documents.Open("C:\.....doc") <----- add a
real file name here

On Error Resume Next
For Each pProp In pDoc.BuiltInDocumentProperties
Debug.Print pProp.Name, pProp.Value
Next
For Each pProp In pDoc.CustomDocumentProperties
Debug.Print pProp.Name, pProp.Value
Next

End Sub
 
Thanks for that - i've been trying to give myself a crash course in macros
but I wasn't anywhere near what you've got! What I am wanting to do is have
a list of hyperlinks in an index something like this:


Link to Document 1 last updated: [savedate for document 1 dd/mm/yy]
Link to Document 2 last updated: [savedate for document 2 dd/mm/yy]
etc.

I would then need the macro to refresh the last saved fields for all the
documents each time the index file was opened.

Is this possible?
 
Yes it's possible. If you write a macro called AutoOpen and attach it to the
document, it will run each time the document is opened. But you're throwing
yourself in the deep end if you don't know much about coding macros. Do you
really want to invest the time learning to swim in this pond?

If all the linked files are in the same folder, you can display the folder
in Windows Explorer set to details view -- that will show you the date last
saved. Mightn't be as elegant or convenient as you'd, but there's zero
effort in doing it, and zero maintenance ...



Tom_Illingworth said:
Thanks for that - i've been trying to give myself a crash course in macros
but I wasn't anywhere near what you've got! What I am wanting to do is
have
a list of hyperlinks in an index something like this:


Link to Document 1 last updated: [savedate for document 1
dd/mm/yy]
Link to Document 2 last updated: [savedate for document 2
dd/mm/yy]
etc.

I would then need the macro to refresh the last saved fields for all the
documents each time the index file was opened.

Is this possible?



Jezebel said:
Retrieving the properties from another document is easy enough. The
challenges here are

a) what triggers the macro - how often do you want to refresh the
properties
from the source documents?
b) which properties do you want? - there are dozens of built-ins, and for
any given document the set of custom properties is open-ended
c) what do you want to do with the retrieved values?


To give you a taste of it, paste this into a code module and run it


Public Sub XYZ()

Dim pProp As Office.DocumentProperty
Dim pDoc As Word.Document

Set pDoc = Documents.Open("C:\.....doc") <----- add a
real file name here

On Error Resume Next
For Each pProp In pDoc.BuiltInDocumentProperties
Debug.Print pProp.Name, pProp.Value
Next
For Each pProp In pDoc.CustomDocumentProperties
Debug.Print pProp.Name, pProp.Value
Next

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top