Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Publisher / Programming / April 2008

Tip: Looking for answers? Try searching our database.

Specifying Object Library References at Runtime

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cory - 21 Apr 2008 20:23 GMT
I have written a rather lengthy set of subs under a publisher document that
(since I have opened them on Pub 2003) are now associated with the 2003
Object Model.  The 2002/xp object model for publisher is for the most part
the same, a few small differences.  

Other people in my office want to use this tool, and are unable to because
when it tries to run it can't compile since it can't find the Publisher 11.0
object library.  Since I have already written the subs and procedures outand
designed a number of userforms, I would rather not have to mess with it too
much.  As I understand there is a way to mess with the VBIDE References
(worked well in Access) so that
If Application.Version = "10.0" Then
   Application.VBIDE.CurrentVBProject.References.AddFromFile "Filename.dll"
End If

can be specified to reference a specific library.  I have tried using
similar statements in Publisher, but it does not seem to be working out well.
Can anyone give me a hand figuring out where the reference objects lie in
publishers version of the VBIDE?  The code examples given in the help files
are non-worky.

Really I just need to check version at run-time (possibly through the
Document_Open event) and reference the appropriate library.  Also, It wont
let me disassociate the 11.0 library already associated with it, so if there
is a way to FORCE it to remove it, that would be helpful as well.

Any help will be appreciated.

Cory
Ed Bennett - 22 Apr 2008 00:39 GMT
> The 2002/xp object model for publisher is for the most part
> the same, a few small differences.  

I'd have to disagree with you there. Superficially they look the same,
but as soon as you try and do anything, you realise that Publisher
2002's OM is far less complete than 2003's.

> can be specified to reference a specific library.  I have tried using
> similar statements in Publisher, but it does not seem to be working out well.
>  Can anyone give me a hand figuring out where the reference objects lie in
> publishers version of the VBIDE?  The code examples given in the help files
> are non-worky.

Do you have a help query that returns the non-worky code examples?

Signature

Ed Bennett - MVP Microsoft Publisher
http://ed.mvps.org

Cory - 23 Apr 2008 19:51 GMT
Certainly!  The following is under the help topic for the IsBroken property
entry in the help.

Debug.Print Application.VBE.vbprojects(1).References(1).IsBroken

When executed returns an error saying method or data member not found.  In
Excel I used a similar statement, and it worked.  I looked at the Application
object in the watch window and saw VBE (I think,  Can't recall right off
hand, working on a different unconnected network right now) as an object
under Application.  Publsihers Application object does not seem to have this
object under it.  There has to be a way to access the References collection.  
Just don't know how.

Cory

> > The 2002/xp object model for publisher is for the most part
> > the same, a few small differences.  
[quoted text clipped - 10 lines]
>
> Do you have a help query that returns the non-worky code examples?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.