VBA Makros compile in Documents but not in Templates

  • Thread starter Hagen von Eitzen
  • Start date
H

Hagen von Eitzen

Hi all,

I wanted to use a well-known method to read the windows registry from
within a Word (Word 2003) makro per
System.PrivateProfileString(...)

If I create a new (empty!) document TEST.DOC and place the makro
there, the thing works as expected.
However, I wanted to add this makro to an existing NORMAL.DOT (which
was not written by me) and if I put the makro there (identical code!),
it won't compile.

In fact, I found out that the list of suggested continuations
displayed after entering "System." and hitting "Ctrl+Space" does not
include PrivateProfileString and differs completely from the
corresponding list when doing the same in TEST.DOC
I suspected that the existing NORMAL.DOT might define something named
System somewhere and this something might hide the usual system, but I
can#t find
anything like that.

I suspect that I'm missing something very stupid here, but who can
tell me what?

Thanks in advance,
Hagen
 
T

Tom Winter

Try qualifying it a little bit more:

Application.System.PrivateProfileString ....
 

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