Refering to code in template (normal.dot) from other templates mud

J

Jesper

Hi

I am searching for a way to be able to referring to subs, functions and
variables in modules within normal.dot, from other template files. I am aware
that I can make a reference to normal.dot, but I must use it in a multiuser
enviroment, where I am not sure where users have there normal.dot file.

I try to make the reference runtime, by find the name of the normal.dot file
(from tamplates) and make the reference that way, by the follwing code :

normalname = Templates.Item("normal.dot").FullName
Set Testref = Templates.Item(1).VBProject.References.AddFromFile(normalname)
MsgBox TemplateProject.Metadata.Mystr
Templates.Item(1).VBProject.References.Remove Testref

When run this I get a message "object required", and no string i writen in a
message box. When looking at the project after, I see that the reference is
made, and of cause not removed cause of error. If I run same code again
without the make of reference again (will cause error) the defined string
(mystr) in module Metadata in normal.dot is displayed. Is it not posible to
use the refference right away???

When trying to single step in code, after making the reference, it says I
can't debug at this time. Why??

I there a better way, since notmal.dot should allready be loaded???

Hope for a quick answer!
 
J

Jesper

Isn't this a managed group???
Shouldn't I as a MSDN subscripter expect to get replay within 2 business
days??
Please answer me!! I am on a schedule.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top