PC Review


Reply
Thread Tools Rate Thread

Edit File Properties: Title, Subject, Keywords, (MetaData) w/ VBA

 
 
Benjamin
Guest
Posts: n/a
 
      25th Aug 2009
I'd like to edit the Title, Subject, & Custom Properties of some files.
right now *.dwg & *.xls.

What's the object or API to use to access the files document properties.
(You know the ones where you right click a file and go to the custom or
summary tab and look at the metadata, i.e. Title, subject etc).

I'd like to to be able to retrieve the data as well as write to it.

Could someone help get me started in the right direction here.
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      25th Aug 2009
see:

http://www.cpearson.com/excel/DocProp.aspx
--
Gary''s Student - gsnu200901


"Benjamin" wrote:

> I'd like to edit the Title, Subject, & Custom Properties of some files.
> right now *.dwg & *.xls.
>
> What's the object or API to use to access the files document properties.
> (You know the ones where you right click a file and go to the custom or
> summary tab and look at the metadata, i.e. Title, subject etc).
>
> I'd like to to be able to retrieve the data as well as write to it.
>
> Could someone help get me started in the right direction here.

 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      25th Aug 2009
As a starter..................but don't miss having a look at Chip's site
that gsnu200901 pointed you to.

Sub documentprops()
'list of properties on a new sheet
rw = 1
Worksheets.Add
For Each p In ActiveWorkbook.BuiltinDocumentProperties
Cells(rw, 1).Value = p.Name
Cells(rw, 4).Value = "=DocProps(" & "A" & rw & ")"
rw = rw + 1
Next
End Sub

Sub customprops()
'list of custom properties on a new sheet
rw = 1
Worksheets.Add
For Each p In ActiveWorkbook.CustomDocumentProperties
Cells(rw, 1).Value = p.Name
Cells(rw, 4).Value = p.Value
rw = rw + 1
Next
End Sub

Sub Add_Custom_Prop()
Dim dp As DocumentProperties
Set dp = ThisWorkbook.CustomDocumentProperties
dp.Add Name:="gordo", _
LinkToContent:=False, _
Type:=msoPropertyTypeNumber, _
Value:=0
End Sub

Sub Add_One_To_Custom_Prop()
'add 1 to "gordo" value
If ActiveSheet.Name = "Sheet1" Then
N = ThisWorkbook.CustomDocumentProperties("gordo").Value
N = N + 1
ActiveSheet.PageSetup.RightHeader = N
ThisWorkbook.CustomDocumentProperties("gordo").Value = N
End If
ActiveSheet.PrintOut
End Sub


Gord Dibben MS Excel MVP

On Tue, 25 Aug 2009 08:52:01 -0700, Benjamin
<(E-Mail Removed)> wrote:

>I'd like to edit the Title, Subject, & Custom Properties of some files.
>right now *.dwg & *.xls.
>
>What's the object or API to use to access the files document properties.
>(You know the ones where you right click a file and go to the custom or
>summary tab and look at the metadata, i.e. Title, subject etc).
>
>I'd like to to be able to retrieve the data as well as write to it.
>
>Could someone help get me started in the right direction here.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
searching keywords of file properties =?Utf-8?B?c21fdHJlaw==?= Windows XP General 9 18th May 2007 02:37 PM
What apps uses the file attributes: title, subject, author, keywords, comments? peter Windows XP Photos 1 3rd Jan 2006 07:20 AM
create file metadata/TITLE from dbfield during report export =?Utf-8?B?cmVi?= Microsoft Access External Data 1 4th Aug 2005 08:32 PM
File Properties Keywords and Categories =?Utf-8?B?S0F1c3RpblJKRg==?= Microsoft Powerpoint 2 9th Jun 2005 07:38 PM
Searching by File Properties/Keywords Jeff Microsoft Windows 2000 File System 0 18th Nov 2003 04:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:33 PM.