Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Macro''''er Macro''''er is offline
external usenet poster
 
Posts: 6
Default Retrieve Document Properties in Word

Hello,

I have several documents in one directory and would like to be able to run a
report on these documents to list the document properties such as Category,
Title, Last created? Can someone please help if there is a built in tool to
accomplish this?

Thank you and I look forward to your response.
--
Smile...it is good for you!
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Retrieve Document Properties in Word

There's no built-in tool, but it is simple enough to achieve with a macro
http://www.gmayor.com/installing_macro.htm :


Sub PropertiesReport()
Dim strFileName As String
Dim strPath As String
Dim oDoc As Document
Dim TargetDoc As Document
Dim proDoc As DocumentProperty
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
With fDialog
.title = "Select folder and click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show -1 Then
MsgBox "Cancelled By User", , _
"List Folder Contents"
Exit Sub
End If
strPath = fDialog.SelectedItems.Item(1)
If Right(strPath, 1) "\" _
Then strPath = strPath + "\"
End With
If Documents.Count 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If
If Left(strPath, 1) = Chr(34) Then
strPath = Mid(strPath, 2, Len(strPath) - 2)
End If
strFileName = Dir$(strPath & "*.doc")
Set TargetDoc = Documents.Add
TargetDoc.Range.InsertAfter "Files in folder " & strPath & vbCr
While Len(strFileName) 0
Set oDoc = Documents.Open(strPath & strFileName)
With oDoc
TargetDoc.Range.InsertAfter .name
For Each proDoc _
In ActiveDocument.BuiltInDocumentProperties
With TargetDoc.Range
.InsertParagraphAfter
.InsertAfter proDoc.name & "= "
On Error Resume Next
.InsertAfter proDoc.Value
End With
Next
TargetDoc.Range.InsertParagraphAfter
.Close SaveChanges:=wdSaveChanges
End With
strFileName = Dir$()
Wend
For Each oPara In TargetDoc.Paragraphs
If InStr(1, oPara.Range, "=") = 0 Then
oPara.Range.Style = "Heading 2"
Else
oPara.Range.Font.Size = 10
With oPara.Range.ParagraphFormat
.LeftIndent = CentimetersToPoints(5)
.RightIndent = CentimetersToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
End With
End If
Next oPara
TargetDoc.Paragraphs(1).Range.Style = "Heading 1"
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Macro''''er wrote:
Hello,

I have several documents in one directory and would like to be able
to run a report on these documents to list the document properties
such as Category, Title, Last created? Can someone please help if
there is a built in tool to accomplish this?

Thank you and I look forward to your response.



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Macro''''er Macro''''er is offline
external usenet poster
 
Posts: 6
Default Retrieve Document Properties in Word

Thank you so much!! I'll try this.
--
Smile...it is good for you!


"Graham Mayor" wrote:

There's no built-in tool, but it is simple enough to achieve with a macro
http://www.gmayor.com/installing_macro.htm :


Sub PropertiesReport()
Dim strFileName As String
Dim strPath As String
Dim oDoc As Document
Dim TargetDoc As Document
Dim proDoc As DocumentProperty
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
With fDialog
.title = "Select folder and click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show -1 Then
MsgBox "Cancelled By User", , _
"List Folder Contents"
Exit Sub
End If
strPath = fDialog.SelectedItems.Item(1)
If Right(strPath, 1) "\" _
Then strPath = strPath + "\"
End With
If Documents.Count 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If
If Left(strPath, 1) = Chr(34) Then
strPath = Mid(strPath, 2, Len(strPath) - 2)
End If
strFileName = Dir$(strPath & "*.doc")
Set TargetDoc = Documents.Add
TargetDoc.Range.InsertAfter "Files in folder " & strPath & vbCr
While Len(strFileName) 0
Set oDoc = Documents.Open(strPath & strFileName)
With oDoc
TargetDoc.Range.InsertAfter .name
For Each proDoc _
In ActiveDocument.BuiltInDocumentProperties
With TargetDoc.Range
.InsertParagraphAfter
.InsertAfter proDoc.name & "= "
On Error Resume Next
.InsertAfter proDoc.Value
End With
Next
TargetDoc.Range.InsertParagraphAfter
.Close SaveChanges:=wdSaveChanges
End With
strFileName = Dir$()
Wend
For Each oPara In TargetDoc.Paragraphs
If InStr(1, oPara.Range, "=") = 0 Then
oPara.Range.Style = "Heading 2"
Else
oPara.Range.Font.Size = 10
With oPara.Range.ParagraphFormat
.LeftIndent = CentimetersToPoints(5)
.RightIndent = CentimetersToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
End With
End If
Next oPara
TargetDoc.Paragraphs(1).Range.Style = "Heading 1"
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Macro''''er wrote:
Hello,

I have several documents in one directory and would like to be able
to run a report on these documents to list the document properties
such as Category, Title, Last created? Can someone please help if
there is a built in tool to accomplish this?

Thank you and I look forward to your response.



.

  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Bod Bod is offline
external usenet poster
 
Posts: 40
Default Retrieve Document Properties in Word

Hi!
We use the "Author" and "Manager" properties in files for the 2 approvers
(should really be "owner" and "approver").
In 2007, the dialogue box is replaced with a new form which doesn't have the
manager field or the hyperlink base (haven't compared anything else).
Is there a way to jump to the good old dialogue box without having to bother
with the new thing, as it is inadequate for my needs.
Better still, maybe I should be making my own dialogue box with the Owner
and Approver fields. It needs to be something hat is workable on other
people's machines too - not specific to mine.
Thanks in advance.

"Graham Mayor" wrote:

There's no built-in tool, but it is simple enough to achieve with a macro
http://www.gmayor.com/installing_macro.htm :


Sub PropertiesReport()
Dim strFileName As String
Dim strPath As String
Dim oDoc As Document
Dim TargetDoc As Document
Dim proDoc As DocumentProperty
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
With fDialog
.title = "Select folder and click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show -1 Then
MsgBox "Cancelled By User", , _
"List Folder Contents"
Exit Sub
End If
strPath = fDialog.SelectedItems.Item(1)
If Right(strPath, 1) "\" _
Then strPath = strPath + "\"
End With
If Documents.Count 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If
If Left(strPath, 1) = Chr(34) Then
strPath = Mid(strPath, 2, Len(strPath) - 2)
End If
strFileName = Dir$(strPath & "*.doc")
Set TargetDoc = Documents.Add
TargetDoc.Range.InsertAfter "Files in folder " & strPath & vbCr
While Len(strFileName) 0
Set oDoc = Documents.Open(strPath & strFileName)
With oDoc
TargetDoc.Range.InsertAfter .name
For Each proDoc _
In ActiveDocument.BuiltInDocumentProperties
With TargetDoc.Range
.InsertParagraphAfter
.InsertAfter proDoc.name & "= "
On Error Resume Next
.InsertAfter proDoc.Value
End With
Next
TargetDoc.Range.InsertParagraphAfter
.Close SaveChanges:=wdSaveChanges
End With
strFileName = Dir$()
Wend
For Each oPara In TargetDoc.Paragraphs
If InStr(1, oPara.Range, "=") = 0 Then
oPara.Range.Style = "Heading 2"
Else
oPara.Range.Font.Size = 10
With oPara.Range.ParagraphFormat
.LeftIndent = CentimetersToPoints(5)
.RightIndent = CentimetersToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphLeft
End With
End If
Next oPara
TargetDoc.Paragraphs(1).Range.Style = "Heading 1"
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Macro''''er wrote:
Hello,

I have several documents in one directory and would like to be able
to run a report on these documents to list the document properties
such as Category, Title, Last created? Can someone please help if
there is a built in tool to accomplish this?

Thank you and I look forward to your response.



.

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced Document Properties to Standard Properties Window? TychaBrahe Microsoft Word Help 1 April 3rd 08 12:25 AM
How do I retrieve a word document thats been deleted? gjg67 Microsoft Word Help 1 November 6th 07 03:31 AM
I need to edit the document properties after properties creation. Jed Microsoft Word Help 3 October 7th 07 12:17 AM
how can i retrieve an unsaved word document zeek Microsoft Word Help 3 July 19th 06 08:21 PM
how do i retrieve my menu bar in a word document jonboy Microsoft Word Help 1 January 10th 06 07:51 PM


All times are GMT +1. The time now is 09:43 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"