C
Cory
OK, this is bugging the hell out of me...
Office XP, Publisher 2002
The VBA reference on msdn says that the DocumentProperties collection (and
thus the DocumentProperty opbject) requires a valid document object. That
makes sense right? This is supposedly part of the "Microsoft Office Object
Model" which would lead one to believe that since Publisher is a part of the
Microsoft Office package, it would inherit the whole object model.
Not the case it seems. Using the ThisDocument object to return the document
under which the code is executing, there is no DocumentProperty object. It
appears in the Object model reference under Office, but damned if I can't
find it to use it in my code. In Word ThisDocument.DocumentProperty is
valid. Not in Publisher.
Not to mention the fact that even examples that are not totally vague about
usage of the documentproperties object/collection, do not give useful code
examples (one of which purports to work in Publisher).
The hey Scriptin' Guy
(http://www.microsoft.com/technet/scriptcenter/resources/qanda/jun06/hey0614.mspx)
article that deals with this mentions Publisher, and says : "Yes, it is a
very simple little script. We start out by creating an instance of the
Excel.Application object. And you’re right: because we’re using Excel we’ve
pretty much limited ourselves to retrieving information about Excel
spreadsheets. What if we wanted to retrieve information about Word documents?
In that case, we’d need to use the Word.Application object. OK, then how
about PowerPoint presentations? That’s easy: we’d need to use the
PowerPoint.Application object. Microsoft Publisher? That’s right:
Publisher.Application."
Well who cares about creating a new instance of the application or opening
another file from the file you want to examine? Grrr! <Shakes fist at
Microsoft> Is it just me or is VBA for Publisher added to the program as an
afterthought. There are so many inconsistencies between publisher and the
REST of Office.
Any help would be greatly appreciated,
Cory
Office XP, Publisher 2002
The VBA reference on msdn says that the DocumentProperties collection (and
thus the DocumentProperty opbject) requires a valid document object. That
makes sense right? This is supposedly part of the "Microsoft Office Object
Model" which would lead one to believe that since Publisher is a part of the
Microsoft Office package, it would inherit the whole object model.
Not the case it seems. Using the ThisDocument object to return the document
under which the code is executing, there is no DocumentProperty object. It
appears in the Object model reference under Office, but damned if I can't
find it to use it in my code. In Word ThisDocument.DocumentProperty is
valid. Not in Publisher.
Not to mention the fact that even examples that are not totally vague about
usage of the documentproperties object/collection, do not give useful code
examples (one of which purports to work in Publisher).
The hey Scriptin' Guy
(http://www.microsoft.com/technet/scriptcenter/resources/qanda/jun06/hey0614.mspx)
article that deals with this mentions Publisher, and says : "Yes, it is a
very simple little script. We start out by creating an instance of the
Excel.Application object. And you’re right: because we’re using Excel we’ve
pretty much limited ourselves to retrieving information about Excel
spreadsheets. What if we wanted to retrieve information about Word documents?
In that case, we’d need to use the Word.Application object. OK, then how
about PowerPoint presentations? That’s easy: we’d need to use the
PowerPoint.Application object. Microsoft Publisher? That’s right:
Publisher.Application."
Well who cares about creating a new instance of the application or opening
another file from the file you want to examine? Grrr! <Shakes fist at
Microsoft> Is it just me or is VBA for Publisher added to the program as an
afterthought. There are so many inconsistencies between publisher and the
REST of Office.
Any help would be greatly appreciated,
Cory