Hi,

how can i access classes, autotext entries, etc. of a global template
(like normal.dot) within a macro.
public methods are accessible through the
Application.Run "MyGlobalTemplate.MyMethod"
command. Is it necessary to add a method for each class, autotext,
etc. that return the object?

thanks, Matthias

Re: Accessing Global Template Objects by fumei

fumei
Fri Jan 18 12:01:15 PST 2008

If the global is loaded you should be able to simply use an autotext from it.
You should also be able to call any procedure from it.

Sub CalledFromGlobal()
Msgbox "Hello from the global template."
End Sub

Simply using:

Call CalledFromGlobal should execute the procedure.

mamue wrote:
>Hi,
>
>how can i access classes, autotext entries, etc. of a global template
>(like normal.dot) within a macro.
>public methods are accessible through the
>Application.Run "MyGlobalTemplate.MyMethod"
>command. Is it necessary to add a method for each class, autotext,
>etc. that return the object?
>
>thanks, Matthias

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/200801/1


Re: Accessing Global Template Objects by mamue

mamue
Mon Jan 21 01:27:12 PST 2008

On Jan 18, 9:01 pm, "fumei via OfficeKB.com" <u37563@uwe> wrote:
> If the global is loaded you should be able to simply use an autotext from it.
> You should also be able to call any procedure from it.
>
> Sub CalledFromGlobal()
> Msgbox "Hello from the global template."
> End Sub
>
> Simply using:
>
> Call CalledFromGlobal should execute the procedure.
>
> mamue wrote:
> >Hi,
>
> >how can i access classes, autotext entries, etc. of a global template
> >(like normal.dot) within a macro.
> >public methods are accessible through the
> >Application.Run "MyGlobalTemplate.MyMethod"
> >command. Is it necessary to add a method for each class, autotext,
> >etc. that return the object?
>
> >thanks, Matthias
>
> --
> Message posted via OfficeKB.comhttp://www.officekb.com/Uwe/Forums.aspx/word-programming/200801/1

and what about classes? as far as i know Application.Run doesn't work
with classes.

Re: Accessing Global Template Objects by Shauna

Shauna
Mon Jan 21 04:16:23 PST 2008

Hi

> and what about classes? as far as i know Application.Run doesn't work
> with classes.

It depends on what you mean. But see
http://www.cpearson.com/excel/Classes.aspx. Chip explains how to declare
and create variables of a class type in multiple projects.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word



"mamue" <mamuesmailbox@googlemail.com> wrote in message
news:bc95a9df-9501-4cdf-8e40-ed7a56461b7d@d70g2000hsb.googlegroups.com...
> On Jan 18, 9:01 pm, "fumei via OfficeKB.com" <u37563@uwe> wrote:
>> If the global is loaded you should be able to simply use an autotext
>> from it.
>> You should also be able to call any procedure from it.
>>
>> Sub CalledFromGlobal()
>> Msgbox "Hello from the global template."
>> End Sub
>>
>> Simply using:
>>
>> Call CalledFromGlobal should execute the procedure.
>>
>> mamue wrote:
>> >Hi,
>>
>> >how can i access classes, autotext entries, etc. of a global
>> >template
>> >(like normal.dot) within a macro.
>> >public methods are accessible through the
>> >Application.Run "MyGlobalTemplate.MyMethod"
>> >command. Is it necessary to add a method for each class, autotext,
>> >etc. that return the object?
>>
>> >thanks, Matthias
>>
>> --
>> Message posted via
>> OfficeKB.comhttp://www.officekb.com/Uwe/Forums.aspx/word-programming/200801/1
>
> and what about classes? as far as i know Application.Run doesn't work
> with classes.



Re: Accessing Global Template Objects by mamue

mamue
Thu Jan 24 09:11:05 PST 2008

On Jan 21, 1:16 pm, "Shauna Kelly"
<ShaunaKe...@SendNoSpamToShaunaKelly.com> wrote:
> Hi
>
> > and what about classes? as far as i know Application.Run doesn't work
> > with classes.
>
> It depends on what you mean. But seehttp://www.cpearson.com/excel/Classes.aspx. Chip explains how to declare
> and create variables of a class type in multiple projects.
>
> Hope this helps.
>
> Shauna Kelly. Microsoft MVP.http://www.shaunakelly.com/word
>
> "mamue" <mamuesmail...@googlemail.com> wrote in message
>
> news:bc95a9df-9501-4cdf-8e40-ed7a56461b7d@d70g2000hsb.googlegroups.com...
>
> > On Jan 18, 9:01 pm, "fumei via OfficeKB.com" <u37563@uwe> wrote:
> >> If the global is loaded you should be able to simply use an autotext
> >> from it.
> >> You should also be able to call any procedure from it.
>
> >> Sub CalledFromGlobal()
> >> Msgbox "Hello from the global template."
> >> End Sub
>
> >> Simply using:
>
> >> Call CalledFromGlobal should execute the procedure.
>
> >> mamue wrote:
> >> >Hi,
>
> >> >how can i access classes, autotext entries, etc. of a global
> >> >template
> >> >(like normal.dot) within a macro.
> >> >public methods are accessible through the
> >> >Application.Run "MyGlobalTemplate.MyMethod"
> >> >command. Is it necessary to add a method for each class, autotext,
> >> >etc. that return the object?
>
> >> >thanks, Matthias
>
> >> --
> >> Message posted via
> >> OfficeKB.comhttp://www.officekb.com/Uwe/Forums.aspx/word-programming/200801/1
>
> > and what about classes? as far as i know Application.Run doesn't work
> > with classes.

Thanks Shauna for the link,

but i need a way to access classes of a global template that isn't
listed under references. my shared classes are kept in a template in
the startup folder.

cheers, matthias

Re: Accessing Global Template Objects by Tony

Tony
Fri Jan 25 02:27:33 PST 2008

> but i need a way to access classes of a global template that isn't
> listed under references. my shared classes are kept in a template in
> the startup folder.

You can't. You must set a reference to a template if you want to use
anything in that template.

--
Enjoy,
Tony