Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Edit File Properties: Title, Subject, Keywords, (MetaData) w/ VBA

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Edit File Properties: Title, Subject, Keywords, (MetaData) w/ VBA

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Edit File Properties: Title, Subject, Keywords, (MetaData) w/ VBA

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").Val ue
N = N + 1
ActiveSheet.PageSetup.RightHeader = N
ThisWorkbook.CustomDocumentProperties("gordo").Val ue = N
End If
ActiveSheet.PrintOut
End Sub


Gord Dibben MS Excel MVP

On Tue, 25 Aug 2009 08:52:01 -0700, 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Choosing a Subject Title, How to be Specific Texas Aggie Excel Programming 3 October 31st 07 01:37 PM
Can I use file information (title, subject,) as fields in Excel? Foz Excel Discussion (Misc queries) 1 September 3rd 07 11:34 AM
How do I delete or edit this- file properties statistics in excel. corco2000 Excel Discussion (Misc queries) 0 December 11th 06 06:14 PM
File, properties, title Eric[_29_] Excel Programming 4 May 12th 05 12:40 PM
Apologies For No Subject. Chart Title via a Macro Alan Excel Programming 0 August 7th 03 06:26 PM


All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"