LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Adding and Changing 'CustomDocumentProperties' from VBA on oth

Tom has included some code already, but FYI, the VB files are just text
really, so you can copy/paste into VBA, with a few alterations.

NickHK

"VBA Dabbler" wrote in message
...
Thanks for the reply, Tom.

I've downloaded the DLL - it looks like you have to be in an application
development environment, like C++, VB, etc. I'm not sure how this can be
used in Visual Basic for Applications (VBA).

Am I missing something?

Regards,
VBA Dabbler

"Tom Ogilvy" wrote:

MS provides a DLL to support this. Unfortunately this article has been
updated to reflect .Net, but the DLL should still work from VBA i would
think

http://support.microsoft.com/default...b;en-us;224351


Here is some information I posted in 1999

===============
Leo,
I think you are trying too hard. In Excel97, I went into the VBE and

into
Tools=References and created a reference to the DSOFile.dll using the
browser.

Then the following code worked fine:

Sub TestDSOFILE()
Dim docProp As DSOleFile.DocumentProperties
Set docProp = PropertyReader.GetDocumentProperties( _
sFilename:="Y:\docs\Excel_quit.xls")
Debug.Print docProp.AppName
Debug.Print docProp.Author
Debug.Print docProp.Name
End Sub

It returned the following
Microsoft Excel
Thomas W. Ogilvy
Excel_quit.xls

Once you have the reference, you can use the object browser to see what
other properties are available.

HTH,
Tom Ogilvy
===============
Of course it needs to be registered with regsvr32

in code
Shell "RegSvr32 ""C:\Winnt\system32\DSOFILE.dll"" /s "

depending on where you placed the file.

if you are willing to open it:

http://www.cpearson.com/excel/docprop.htm
at Chip Pearson's site.



--
Regards,
Tom Ogilvy

"VBA Dabbler" <VBA wrote in message
...
Does anyone know the VBA code to add or change a

'CustomDocumentProperty'
in
an Office document at the file level without opening the document?

Assume that the VBA code will be running in an Excel workbook.






 
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
Prevent formula from changing when adding in cells Rhett C[_2_] Excel Discussion (Misc queries) 2 October 2nd 09 09:35 PM
Adding Numbers and Changing colors Shoulder Excel Worksheet Functions 2 December 24th 07 02:26 AM
changing datas when adding row ? [email protected] Excel Worksheet Functions 0 June 12th 06 08:40 PM
CustomDocumentProperties Robert Hind Excel Programming 7 December 21st 03 01:59 PM
adding changing number of days Aivars Excel Programming 2 July 8th 03 03:26 PM


All times are GMT +1. The time now is 12:28 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"