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 / Word / Programming / September 2004

Tip: Looking for answers? Try searching our database.

ObjLibrary references question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed - 29 Sep 2004 17:10 GMT
Please correct me if my thinking is off:
When I set a reference to an object library, it's saved in the template,
yes?  So if I want to distribute a document with a macro that references a
certain object library, I need to create a template for it with the
reference set in that template's VBIDE?  And that template then will reside
in the other user's StartUp folder?  Did I get them all right?

Ed
Word Heretic - 30 Sep 2004 09:59 GMT
G'day "Ed" <ed_millis@NO_SPAM.yahoo.com>,

Documents can also contain VBProjects. You can drag your template
magic over, or do it programatically using ActiveDocument.VbProject

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)

Ed reckoned:

>Please correct me if my thinking is off:
>When I set a reference to an object library, it's saved in the template,
[quoted text clipped - 4 lines]
>
>Ed
Ed - 30 Sep 2004 15:12 GMT
Thank you for the reply, Steve.  My biggest concern was setting a reference
to a certain object library in the VBE - will that reference move with a
macro in the document? or is it set in my template, and if another user
opens the doc with his template, the reference will be missing and the macro
inoperative?

As for setting the reference programmatically, I did a Google on the
newsgroup, but came up with a lot of "it doesn't work" posts, including a
conversation between you and Howard Kaikow
(http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=eDKEkvBaEHA.3708
%40TK2MSFTNGP10.phx.gbl&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%2
6selm%3DeDKEkvBaEHA.3708%2540TK2MSFTNGP10.phx.gbl).  If there is more info
on a way to detect references and set the necessary ones using a macro, I
would be most grateful for any pointers.

Ed

> G'day "Ed" <ed_millis@NO_SPAM.yahoo.com>,
>
[quoted text clipped - 16 lines]
> >
> >Ed
Jean-Guy Marcil - 30 Sep 2004 17:05 GMT
Bonjour,

Dans son message, < Ed > ?crivait :
In this message, < Ed > wrote:

|| Thank you for the reply, Steve.  My biggest concern was setting a
reference
|| to a certain object library in the VBE - will that reference move with a
|| macro in the document? or is it set in my template, and if another user
|| opens the doc with his template, the reference will be missing and the
macro
|| inoperative?

Example:

I have template, called TempA.dot
It contains macros and a reference to library qwerty.olb.

I create a document from TempA and I save it as DocA.doc.
As long as I open DocA on my machine and that TempA.dot is present, all the
macros will run fine, including the references to qwerty.olb.

Now, I send to my colleague DocA.doc.
He opens it. But because he does not have TempA.dot, none of the macros will
be  available. So the Reference question becomes moot because the template
is missing, therefore the whole project is unavailable (so the macros and
the references are not available as well).

The same would happen to my DocA.doc on my machine if I were to delete
TempA.dot.

Does this make any sense?

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Ed - 30 Sep 2004 17:30 GMT
Thank you, Jean-Guy.  If I've gotten this right:  I need to create a
template with all the references and macros I need, create a document from
this template with a VB project using these macros as desired, and ship both
document and template to the other user.

One last question, if I may:  is it sufficient to just put this new template
in the Templates folder?  or does it need to be added through
Tools>>Templates and Addins?

Ed

> Bonjour,
>
[quoted text clipped - 28 lines]
>
> Does this make any sense?
Jean-Guy Marcil - 30 Sep 2004 19:21 GMT
Bonjour,

Dans son message, < Ed > ?crivait :
In this message, < Ed > wrote:

|| Thank you, Jean-Guy.  If I've gotten this right:  I need to create a
|| template with all the references and macros I need, create a document
from
|| this template with a VB project using these macros as desired, and ship
both
|| document and template to the other user.
||
|| One last question, if I may:  is it sufficient to just put this new
template
|| in the Templates folder?  or does it need to be added through
|| Tools>>Templates and Addins?

Yes, it is sufficient.

If you use it as an add-in it means it will be loaded every time Word
starts. This is a global template. Unless you want the code, toolbars,
autotexts, etc, available to all documents, then it is not necessary to
place the template in the Add-in folder.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Ed - 30 Sep 2004 19:36 GMT
Thank you for all your help!

Ed

> Bonjour,
>
[quoted text clipped - 19 lines]
> autotexts, etc, available to all documents, then it is not necessary to
> place the template in the Add-in folder.
 
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.