Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Custom Document Properties in Word documents and Excel workbooks

Does anyone know how to read the Custom Document properties of a Word document or Excel workbook from VBA without opening the workbook or Word document?

This can be done interactively manually by right-clicking on the file name and selecting Properties | Custom on the dialog box that appears. This does not involve opening the file.

However, does anyone know if there is a way of accomplishing the above without opening the file?

I need to a hierarchical directory tree-walk on a folder that contains many thousands of Excel workbooks and Word documents, looking for specific Custom Document properties. I can do so, if I open and close the files, but this is very long-winded and might not be necessary.

I should say that I use Custom Document properties extensively in Excel.

Any insights would be appreciated. Thank you.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Custom Document Properties in Word documents and Excel workbooks

hi,

this macro works on xl2010

Sub Macro1()
Dim arrHeaders(35)
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\Users\Public\Documents")
For i = 0 To 34
arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
Next
For Each strFileName In objFolder.Items
For i = 0 To 34
Debug.Print arrHeaders(i) _
& ": " & objFolder.GetDetailsOf(strFileName, i)
Next
Next
End Sub

isabelle

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Custom Document Properties in Word documents and Excel workbooks

I think the key words in the OP's Q are "Custom Document Properties".
Note that the suggested approach only works with "Extended File
Properties"!

This task requires the OLE File Property component named "dsofile.dll".
To work with Office12 and later will also require the Office 2007
Compatibility Pack.

I'm not sure, but I think you may also be able to do this via ADODB.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Custom Document Properties in Word documents and Excel workbooks

On Sat, 09 Feb 2013 13:59:55 -0500, GS wrote:

I think the key words in the OP's Q are "Custom Document Properties".
Note that the suggested approach only works with "Extended File
Properties"!


Good Point


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Custom Document Properties in Word documents and Excel workbooks

GS wrote on 09/02/2013 :
I think the key words in the OP's Q are "Custom Document Properties". Note
that the suggested approach only works with "Extended File Properties"!

This task requires the OLE File Property component named "dsofile.dll". To
work with Office12 and later will also require the Office 2007 Compatibility
Pack.

I'm not sure, but I think you may also be able to do this via ADODB.


You can download dsofile here...

http://support.microsoft.com/kb/224351

...which includes samples and source code.

You can get the Office Compatibility Pack here...

http://www.microsoft.com/en-us/downl...ails.aspx?id=3

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Custom Document Properties in Word documents and Excel workbooks

thanks GS for this point, also, more informations here for the systems
64 bits

http://dotnet.dzone.com/articles/tip...ile-x64-os-and

isabelle

Le 2013-02-09 16:37, GS a écrit :
GS wrote on 09/02/2013 :
I think the key words in the OP's Q are "Custom Document Properties".
Note that the suggested approach only works with "Extended File
Properties"!

This task requires the OLE File Property component named
"dsofile.dll". To work with Office12 and later will also require the
Office 2007 Compatibility Pack.

I'm not sure, but I think you may also be able to do this via ADODB.


You can download dsofile here...

http://support.microsoft.com/kb/224351

..which includes samples and source code.

You can get the Office Compatibility Pack here...

http://www.microsoft.com/en-us/downl...ails.aspx?id=3

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Custom Document Properties in Word documents and Excel workbooks

Thanks, Isabelle! Good article. What surprises me is that msoshext.dll
doesn't ship with Office NOR dsofile.dll since it's dependant for use
with MSO12 and later.

I find the msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

...on my XP machine. I haven't installed the Compatibility Pack on my
Win7 Pro x64 machine as yet and so can't say where it installs. (I
assume Program Files (x86)\Common Files\Microsoft Shared\OFFICE12)

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Custom Document Properties in Word documents and Excel workbooks

I just installed the Office 2007 Compatibility Pack on my Win7 Pro x64
machine and it put msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

...NOT under Program Files (x86) as I assumed!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 277
Default Custom Document Properties in Word documents and Excel workbooks

On Sun, 10 Feb 2013 04:03:44 -0500, GS wrote:

Thanks, Isabelle! Good article. What surprises me is that msoshext.dll
doesn't ship with Office NOR dsofile.dll since it's dependant for use
with MSO12 and later.

I find the msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

..on my XP machine. I haven't installed the Compatibility Pack on my
Win7 Pro x64 machine as yet and so can't say where it installs. (I
assume Program Files (x86)\Common Files\Microsoft Shared\OFFICE12)


The Microsoft page I saw said it was good for OSes up to Vista (so I
did Not DL it), so maybe this is addressed in a different manner in
Windows 7 systems, and that is why it is no longer simply provided or
integrated in?


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Custom Document Properties in Word documents and Excel workbooks

CellShocked formulated the question :
On Sun, 10 Feb 2013 04:03:44 -0500, GS wrote:

Thanks, Isabelle! Good article. What surprises me is that msoshext.dll
doesn't ship with Office NOR dsofile.dll since it's dependant for use
with MSO12 and later.

I find the msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

..on my XP machine. I haven't installed the Compatibility Pack on my
Win7 Pro x64 machine as yet and so can't say where it installs. (I
assume Program Files (x86)\Common Files\Microsoft Shared\OFFICE12)


The Microsoft page I saw said it was good for OSes up to Vista (so I
did Not DL it), so maybe this is addressed in a different manner in
Windows 7 systems, and that is why it is no longer simply provided or
integrated in?


I installed the Office 2007 Compatibility Pack and dsofile and all is
working fine on my Win7 Pro x64 machine!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Custom Document Properties in Word documents and Excel workbooks

hi GS,

i think so, on my new pc, this file is located here

C: \ Program Files \ Common Files \ Microsoft Shared \ Office14

isabelle

Le 2013-02-10 04:03, GS a écrit :
Thanks, Isabelle! Good article. What surprises me is that msoshext.dll
doesn't ship with Office NOR dsofile.dll since it's dependant for use
with MSO12 and later.

I find the msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

..on my XP machine. I haven't installed the Compatibility Pack on my
Win7 Pro x64 machine as yet and so can't say where it installs. (I
assume Program Files (x86)\Common Files\Microsoft Shared\OFFICE12)

  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 277
Default Custom Document Properties in Word documents and Excel workbooks

On Sun, 10 Feb 2013 08:46:25 -0500, GS wrote:

CellShocked formulated the question :
On Sun, 10 Feb 2013 04:03:44 -0500, GS wrote:

Thanks, Isabelle! Good article. What surprises me is that msoshext.dll
doesn't ship with Office NOR dsofile.dll since it's dependant for use
with MSO12 and later.

I find the msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

..on my XP machine. I haven't installed the Compatibility Pack on my
Win7 Pro x64 machine as yet and so can't say where it installs. (I
assume Program Files (x86)\Common Files\Microsoft Shared\OFFICE12)


The Microsoft page I saw said it was good for OSes up to Vista (so I
did Not DL it), so maybe this is addressed in a different manner in
Windows 7 systems, and that is why it is no longer simply provided or
integrated in?


I installed the Office 2007 Compatibility Pack and dsofile and all is
working fine on my Win7 Pro x64 machine!



I didn't say it wouldn't install or work.

I just mentioned that the DL page stated what OSes it was for, and that
is why I didn't grab it.

I probably already have it and don't know it.
  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Custom Document Properties in Word documents and Excel workbooks

CellShocked submitted this idea :
I didn't say it wouldn't install or work.

I just mentioned that the DL page stated what OSes it was for, and that
is why I didn't grab it.

I probably already have it and don't know it.


I would think that at the time the page was written Vista was the
latest OS since Dsofile.dll hasn't been updated since 2007!<g

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Custom Document Properties in Word documents and Excel workbooks

isabelle explained on 10/02/2013 :
hi GS,

i think so, on my new pc, this file is located here

C: \ Program Files \ Common Files \ Microsoft Shared \ Office14

isabelle

Le 2013-02-10 04:03, GS a écrit :
Thanks, Isabelle! Good article. What surprises me is that msoshext.dll
doesn't ship with Office NOR dsofile.dll since it's dependant for use
with MSO12 and later.

I find the msoshext.dll here...

C:\Program Files\Common Files\Microsoft Shared\OFFICE12

..on my XP machine. I haven't installed the Compatibility Pack on my
Win7 Pro x64 machine as yet and so can't say where it installs. (I
assume Program Files (x86)\Common Files\Microsoft Shared\OFFICE12)


I'm of the opinion that installing to *Program Files* on an x64 machine
is probably forced (ie: hard coded) since most x86 stuff installs under
*Program Files (x86)*!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 277
Default Custom Document Properties in Word documents and Excel workbooks

On Sun, 10 Feb 2013 11:19:12 -0500, GS wrote:

CellShocked submitted this idea :
I didn't say it wouldn't install or work.

I just mentioned that the DL page stated what OSes it was for, and that
is why I didn't grab it.

I probably already have it and don't know it.


I would think that at the time the page was written Vista was the
latest OS since Dsofile.dll hasn't been updated since 2007!<g



Ahhh... the old 'forgot to note da age of da page' thing...
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
Converting Word documents into Excel document Vicatra Excel Discussion (Misc queries) 1 March 26th 09 10:15 PM
Retrieving custom document properties - Excel 2007 Barb Reinhardt Excel Programming 3 August 7th 08 04:33 PM
How can I using Excel custom document properties in the header? ecalvo Excel Worksheet Functions 4 November 3rd 05 09:29 PM
How can I set Custom DOC Properties in Word from Excel Stu78[_2_] Excel Programming 0 August 4th 05 03:20 PM
Accessing custom document properties in Word? quartz[_2_] Excel Programming 1 January 19th 05 02:27 AM


All times are GMT +1. The time now is 02:42 AM.

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

About Us

"It's about Microsoft Excel"