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!
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!