'======================================================================================== 'Get MS Office document properties 'by John Beardsworth 26/10/07 'version 1.0 'Loops through selected media items and grabs file properties '======================================================================================== 'While a script could start Word and interrogate the document properties, there's another 'method which is much faster. You install Microsoft's dsoFile and use that dll to query 'Office documents without opening Word or whatever. 'See http://www.microsoft.com/technet/community/columns/scripts/sg0305.mspx#EFE Const kMsgBoxTitle = "iView MediaPro" If (MsgBox("This script will get properties from MS Office documents" +VbCr + "and copy it into catalogue fields.", 65, kMsgBoxTitle) = vbOk) Then Main() End If Sub Main() Set app = CreateObject("iView.Application") ' get the active catalog If (app.Catalogs.count = 0) Then MsgBox "Please launch iView MediaPro.", vbCritical, kMsgBoxTitle Elseif (app.ActiveCatalog.Selection.Count = 0) Then MsgBox "You need to select at least one media item in the active catalog in order to use this script.", vbCritical, kMsgBoxTitle Else For Each ivItem In app.ActiveCatalog.Selection Set objFile = CreateObject("DSOFile.OleDocumentProperties") objFile.Open(ivItem.Path) ivItem.Annotations.Description = objFile.SummaryProperties.Subject & objFile.SummaryProperties.Comments ivItem.Annotations.Title = objFile.SummaryProperties.Title ivItem.Annotations.Keywords = ivItem.Annotations.Keywords & "," & objFile.SummaryProperties.Keywords 'just for reference msg = "Application name: " & objFile.SummaryProperties.ApplicationName msg = msg & vbcrlf & "Author: " & objFile.SummaryProperties.Author msg = msg & vbcrlf & "Application name: " & objFile.SummaryProperties.ApplicationName msg = msg & vbcrlf & "Author: " & objFile.SummaryProperties.Author msg = msg & vbcrlf & "Byte count: " & objFile.SummaryProperties.ByteCount msg = msg & vbcrlf & "Category: " & objFile.SummaryProperties.Category msg = msg & vbcrlf & "Character count: " & objFile.SummaryProperties.CharacterCount msg = msg & vbcrlf & "Character count with spaces: " & objFile.SummaryProperties.CharacterCountWithSpaces msg = msg & vbcrlf & "Comments: " & objFile.SummaryProperties.Comments msg = msg & vbcrlf & "Company: " & objFile.SummaryProperties.Company msg = msg & vbcrlf & "Date created: " & objFile.SummaryProperties.DateCreated msg = msg & vbcrlf & "Date last printed: " & objFile.SummaryProperties.DateLastPrinted msg = msg & vbcrlf & "Date last saved: " & objFile.SummaryProperties.DateLastSaved msg = msg & vbcrlf & "Hidden slide count: " & objFile.SummaryProperties.HiddenSlideCount msg = msg & vbcrlf & "Keywords: " & objFile.SummaryProperties.Keywords msg = msg & vbcrlf & "Last saved by: " & objFile.SummaryProperties.LastSavedBy msg = msg & vbcrlf & "Line count: " & objFile.SummaryProperties.LineCount msg = msg & vbcrlf & "Manager: " & objFile.SummaryProperties.Manager msg = msg & vbcrlf & "Multimedia clip count: " & objFile.SummaryProperties.MultimediaClipCount msg = msg & vbcrlf & "Note count: " & objFile.SummaryProperties.NoteCount msg = msg & vbcrlf & "Page count: " & objFile.SummaryProperties.PageCount msg = msg & vbcrlf & "Paragraph count: " & objFile.SummaryProperties.ParagraphCount msg = msg & vbcrlf & "Presentation format: " & objFile.SummaryProperties.PresentationFormat msg = msg & vbcrlf & "Revision number: " & objFile.SummaryProperties.RevisionNumber msg = msg & vbcrlf & "Shared document: " & objFile.SummaryProperties.SharedDocument msg = msg & vbcrlf & "Slide count: " & objFile.SummaryProperties.SlideCount msg = msg & vbcrlf & "Subject: " & objFile.SummaryProperties.Subject msg = msg & vbcrlf & "Template: " & objFile.SummaryProperties.Template msg = msg & vbcrlf & "Title: " & objFile.SummaryProperties.Title msg = msg & vbcrlf & "Total edit time: " & objFile.SummaryProperties.TotalEditTime msg = msg & vbcrlf & "Version: " & objFile.SummaryProperties.Version msg = msg & vbcrlf & "Word count: " & objFile.SummaryProperties.WordCount msgbox msg next End If End Sub