Get & Set Custom Doc Props 
Author Message
 Get & Set Custom Doc Props

Has anyone been able to use MSOC.DLL (the one that ships with Office 97) to
Get and Set Custom Document Properties via VB5?  I've tried and received
spurious results.

Background: I don't want to display the Properties dialog box,  I want to
read and write to the custom properties directly via my code.  Using a Word
object takes too much time.  The freeware thing (CPPSUM.DLL) mentioned in
another thread returns Summary Information, and as such won't solve the
problem.

I'd forego MSOC.DLL if I knew what API calls to make and how to make them.

Even if you haven't tried MSOC.DLL, please let me know.  It seems as though
this question has gone unread before and scrolled away.
------
.nsr.



Sat, 23 Jun 2001 03:00:00 GMT  
 Get & Set Custom Doc Props
Hi Tsar,

I looked at it with the VB object browser. It seems that this DLL is
provided for downward compatibility and will not work for Office 8
stuff, like Word97.

Thats my leaping conclusion as I have not hacked at it the way
you have.

Best of Luck, Mark

Quote:

>Has anyone been able to use MSOC.DLL (the one that ships with Office 97) to
>Get and Set Custom Document Properties via VB5?  I've tried and received
>spurious results.

>Background: I don't want to display the Properties dialog box,  I want to
>read and write to the custom properties directly via my code.  Using a Word
>object takes too much time.  The freeware thing (CPPSUM.DLL) mentioned in
>another thread returns Summary Information, and as such won't solve the
>problem.

>I'd forego MSOC.DLL if I knew what API calls to make and how to make them.

>Even if you haven't tried MSOC.DLL, please let me know.  It seems as though
>this question has gone unread before and scrolled away.
>------
>.nsr.



Sat, 23 Jun 2001 03:00:00 GMT  
 Get & Set Custom Doc Props
Hi Tsar,

Quote:
> Has anyone been able to use MSOC.DLL (the one that ships with Office 97) to
> Get and Set Custom Document Properties via VB5?  I've tried and received
> spurious results.

I've tried a few times, from within Excel 97, not VB5, and also had spurious
results.  FWIW, the code I'm using can be found at
www.BMSLtd.co.uk/Spreads/DocProps.zip, which should be readily copyable to
VB5 (it's in an Excel workbook).

Also, do you have Office 2000 installed on that machine?  Office 2000
completely trashes them MSOC functionality; the OfficeCompatible Automation
interface is directed to the main Office 2000 object library, which doesn't
actually provide such an interface!

It looks as though the msoc.dll functionality is being dropped in Office
2000, meaning that developers such as ourselves will not be able to hook into
this functionality.


your voice to the campaign to include support for the OfficeCompatible
functions in Office 2000.*

 Regards

 Stephen Bullen
 Microsoft MVP - Excel
 http://www.BMSLtd.co.uk



Sun, 24 Jun 2001 03:00:00 GMT  
 Get & Set Custom Doc Props
TFTR

Office 2000 is not on this dev machine, nor the testing machines.  Most are
fairly clean Office 97 SR1 machines, with a sprinkling of SR2.  To date, we
can't find a common denominator as to why the OC calls on my machine work,
but not on the others.

Yes, I'm sad to see that OC is missing from O2k.  I may ditch OC and try the
API route, if someone gives me some idea of how to do it through API calls.


Quote:
>Hi Tsar,

>> Has anyone been able to use MSOC.DLL (the one that ships with Office 97)
to
>> Get and Set Custom Document Properties via VB5?  I've tried and received
>> spurious results.

>I've tried a few times, from within Excel 97, not VB5, and also had
spurious
>results.  FWIW, the code I'm using can be found at
>www.BMSLtd.co.uk/Spreads/DocProps.zip, which should be readily copyable to
>VB5 (it's in an Excel workbook).

>Also, do you have Office 2000 installed on that machine?  Office 2000
>completely trashes them MSOC functionality; the OfficeCompatible Automation
>interface is directed to the main Office 2000 object library, which doesn't
>actually provide such an interface!

>It looks as though the msoc.dll functionality is being dropped in Office
>2000, meaning that developers such as ourselves will not be able to hook
into
>this functionality.


>your voice to the campaign to include support for the OfficeCompatible
>functions in Office 2000.*

> Regards

> Stephen Bullen
> Microsoft MVP - Excel
> http://www.BMSLtd.co.uk



Sun, 24 Jun 2001 03:00:00 GMT  
 Get & Set Custom Doc Props
Mark:

Pardon my ignorance, but what leads you to believe that MSOC.DLL (although
shipped w/ O97), is intended to work only w/ previous versions of Office?

The MS doc (included w/ the sample app) makes no mention of the distinction.
I realize quoting MS docs and sample apps, is many times much like trying to
glean factual information from a tabloid newspaper, but that's all I have to
go on.

The education would be greatly appreciated.


Quote:
>Hi Tsar,

>I looked at it with the VB object browser. It seems that this DLL is
>provided for downward compatibility and will not work for Office 8
>stuff, like Word97.

>Thats my leaping conclusion as I have not hacked at it the way
>you have.

>Best of Luck, Mark

>>Has anyone been able to use MSOC.DLL (the one that ships with Office 97)
to
>>Get and Set Custom Document Properties via VB5?  I've tried and received
>>spurious results.

>>Background: I don't want to display the Properties dialog box,  I want to
>>read and write to the custom properties directly via my code.  Using a
Word
>>object takes too much time.  The freeware thing (CPPSUM.DLL) mentioned in
>>another thread returns Summary Information, and as such won't solve the
>>problem.

>>I'd forego MSOC.DLL if I knew what API calls to make and how to make them.

>>Even if you haven't tried MSOC.DLL, please let me know.  It seems as
though
>>this question has gone unread before and scrolled away.
>>------
>>.nsr.



Mon, 25 Jun 2001 03:00:00 GMT  
 Get & Set Custom Doc Props
I'm doing some experimentation into this. Once I have a decently working
class module, I plan to post it on my website. may be a few weeks though. Be
assured, it can be done, though working from within Word, it seems that the
techniques are a bit different from those of the VB5 sample app that appears
in MSDN.

OfficeCompatible in msoc.dll will work both with Office 97 documents and
earlier versions of Word back to Word 6.

For an older solution which will only read, but not write, the built-in
document properties, see the sample code on my FAQ page. Follow the link in
my signature.

Regards
Jonathan West - Word MVP
Multilinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email

Quote:

>Mark:

>Pardon my ignorance, but what leads you to believe that MSOC.DLL (although
>shipped w/ O97), is intended to work only w/ previous versions of Office?

>The MS doc (included w/ the sample app) makes no mention of the
distinction.
>I realize quoting MS docs and sample apps, is many times much like trying
to
>glean factual information from a tabloid newspaper, but that's all I have
to
>go on.

>The education would be greatly appreciated.



>>Hi Tsar,

>>I looked at it with the VB object browser. It seems that this DLL is
>>provided for downward compatibility and will not work for Office 8
>>stuff, like Word97.

>>Thats my leaping conclusion as I have not hacked at it the way
>>you have.

>>Best of Luck, Mark

>>>Has anyone been able to use MSOC.DLL (the one that ships with Office 97)
>to
>>>Get and Set Custom Document Properties via VB5?  I've tried and received
>>>spurious results.

>>>Background: I don't want to display the Properties dialog box,  I want to
>>>read and write to the custom properties directly via my code.  Using a
>Word
>>>object takes too much time.  The freeware thing (CPPSUM.DLL) mentioned in
>>>another thread returns Summary Information, and as such won't solve the
>>>problem.

>>>I'd forego MSOC.DLL if I knew what API calls to make and how to make
them.

>>>Even if you haven't tried MSOC.DLL, please let me know.  It seems as
>though
>>>this question has gone unread before and scrolled away.
>>>------
>>>.nsr.



Tue, 26 Jun 2001 03:00:00 GMT  
 Get & Set Custom Doc Props


Quote:
>Has anyone been able to use MSOC.DLL (the one that ships with Office 97) to
>Get and Set Custom Document Properties via VB5?  I've tried and received
>spurious results.

<snip>

Quote:
>I'd forego MSOC.DLL if I knew what API calls to make and how to make them.

It's the IPropertySetStorage interface.  Once you get an IStorage
pointer from StgOpenStorage, you can just QI for IPropertySetStorage.
The API is pretty well defined.

This is all pretty simple from C++, but it might be a tad tricky in
VB.  You'd probably have to write your own IDL to define the
interfaces and define StgOpenStorage.  ISTR seeing some structured
storage ActiveX objects out there that will handle all this stuff, but
I don't remember any URLs offhand.

--
 David Foster         |  People don't want to be healed, they want a nice

 finger for PGP key   |  lights around it. -- The Journal of Albion Moonlight



Tue, 26 Jun 2001 03:00:00 GMT  
 Get & Set Custom Doc Props

Quote:
>This is all pretty simple from C++, but it might be a tad tricky in
>VB.  You'd probably have to write your own IDL to define the
>interfaces and define StgOpenStorage.  ISTR seeing some structured
>storage ActiveX objects out there that will handle all this stuff, but
>I don't remember any URLs offhand.

One that comes to mind is from Desaware - http://www.desaware.com IIRC

--
Scott Matthewman                              Senior Technical Analyst

----------------------------------------------------------------------
This message has been posted to a public newsgroup. Please post any
replies to the same newsgroup rather than sending private email.
======================================================================



Tue, 26 Jun 2001 03:00:00 GMT  
 Get & Set Custom Doc Props
Thanks, but no where on the Desaware site could I find anything related to
what I'm trying to accomplish.


Quote:


>>This is all pretty simple from C++, but it might be a tad tricky in
>>VB.  You'd probably have to write your own IDL to define the
>>interfaces and define StgOpenStorage.  ISTR seeing some structured
>>storage ActiveX objects out there that will handle all this stuff, but
>>I don't remember any URLs offhand.

>One that comes to mind is from Desaware - http://www.desaware.com IIRC

>--
>Scott Matthewman                              Senior Technical Analyst

>----------------------------------------------------------------------
>This message has been posted to a public newsgroup. Please post any
>replies to the same newsgroup rather than sending private email.
>======================================================================



Tue, 26 Jun 2001 03:00:00 GMT  
 Get & Set Custom Doc Props
Thanks, but I don't know enough about C++ to even know where to begin.


Quote:


>>Has anyone been able to use MSOC.DLL (the one that ships with Office 97)
to
>>Get and Set Custom Document Properties via VB5?  I've tried and received
>>spurious results.

><snip>

>>I'd forego MSOC.DLL if I knew what API calls to make and how to make them.

>It's the IPropertySetStorage interface.  Once you get an IStorage
>pointer from StgOpenStorage, you can just QI for IPropertySetStorage.
>The API is pretty well defined.

>This is all pretty simple from C++, but it might be a tad tricky in
>VB.  You'd probably have to write your own IDL to define the
>interfaces and define StgOpenStorage.  ISTR seeing some structured
>storage ActiveX objects out there that will handle all this stuff, but
>I don't remember any URLs offhand.

>--
> David Foster         |  People don't want to be healed, they want a nice

> finger for PGP key   |  lights around it. -- The Journal of Albion

Moonlight


Tue, 26 Jun 2001 03:00:00 GMT  
 Get & Set Custom Doc Props

Quote:
>Thanks, but no where on the Desaware site could I find anything related
to
>what I'm trying to accomplish.

The "StorageTools" product provides access to OLE structured storage.
You can download a demo from their site.

Together with David's pointers in his post, and possibly the Word BIFF
documentation at http://premium.microsoft.com/msdn/library (free, but
you need to register on-line) you might be able to do the job you want.
Naturally (& annoyingly) the MS documentation is aimed at people
familiar with C++ notation and concepts, but should be decipherable if
you concentrate really hard (I find a point or two of beer helps
enormously with this task!)

Hope this helps,

Scott
--
Scott Matthewman                              Senior Technical Analyst

----------------------------------------------------------------------
This message has been posted to a public newsgroup. Please post any
replies to the same newsgroup rather than sending private email.
======================================================================



Fri, 29 Jun 2001 03:00:00 GMT  
 Get & Set Custom Doc Props
Update:  MS Support has replied that MSOC.DLL seems to work only on NT
Server machines.  My development machine is not NT Server, but it does work.
I do have the NT 4.0 resource kit installed, as well as some other stuff, so
I'm going to look at the dependencies in MSOC.DLL to see if the dependent
files on my machine differ from those of the users for whom MSOC.DLL fails.

This may be all moot, since it seems more than likely that the functionality
that MSOC.DLL provides is not going to be included with O2k.

At this point, I'm going to see if I can get a C++ developer here at work to
create a COM application based upon KB Article: Q186898.


Quote:
>Hi Tsar,

>> Has anyone been able to use MSOC.DLL (the one that ships with Office 97)
to
>> Get and Set Custom Document Properties via VB5?  I've tried and received
>> spurious results.

>I've tried a few times, from within Excel 97, not VB5, and also had
spurious
>results.  FWIW, the code I'm using can be found at
>www.BMSLtd.co.uk/Spreads/DocProps.zip, which should be readily copyable to
>VB5 (it's in an Excel workbook).

>Also, do you have Office 2000 installed on that machine?  Office 2000
>completely trashes them MSOC functionality; the OfficeCompatible Automation
>interface is directed to the main Office 2000 object library, which doesn't
>actually provide such an interface!

>It looks as though the msoc.dll functionality is being dropped in Office
>2000, meaning that developers such as ourselves will not be able to hook
into
>this functionality.


>your voice to the campaign to include support for the OfficeCompatible
>functions in Office 2000.*

> Regards

> Stephen Bullen
> Microsoft MVP - Excel
> http://www.BMSLtd.co.uk



Tue, 03 Jul 2001 03:00:00 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Using Dsofile.dll to list Custom Doc Props

2. Merging OLE wav file into Word Custom Doc Prop

3. Setting shape custom prop to page's property

4. Automation/setting of doc custom properties problem

5. Headers&Footers: Custom Doc Property or Bookmark?

6. Selecting an Address to Merge into Word Doc Props

7. Doc props from other docs

8. add & set lines to .doc

9. Error in Fixed List Custom Prop?

10. Setting the databasename prop for a data control

11. DBCombo produces GPF when ListField-Prop. is set

12. Setting Multi-Select prop on ListBox

 

 
Powered by phpBB® Forum Software