RegOpenKeyEx return codes

S

sydneygirl

Help - I'm modifying a macro library, so that the macros will run with Office XP. This includes a number of API function calls, which are reading Registry values, eg to pick up the location of the User Templates

In the function call RegOpenKeyEx(), I've changed the subkey value so that it points to the new Registry location ("software\microsoft\office\10.0\common\general\usertemplates"), but I get a return code (error) of 2. I have checked the registry and the key is definitely there

Does anyone know what return code 2 is?
 
T

Tom Winter

Depending on what the code does, you might just want to use:

Application.Options.DefaultFilePath(wdUserTemplatesPath)

Here is documentation on RegOpenKeyEx:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regopenkeyex.asp
--
Tom Winter
(e-mail address removed)
www.AmosFiveSix.com



sydneygirl said:
Help - I'm modifying a macro library, so that the macros will run with
Office XP. This includes a number of API function calls, which are reading
Registry values, eg to pick up the location of the User Templates.
In the function call RegOpenKeyEx(), I've changed the subkey value so that
it points to the new Registry location
("software\microsoft\office\10.0\common\general\usertemplates"), but I get a
return code (error) of 2. I have checked the registry and the key is
definitely there.
 
S

sydneygirl

Thank you the Application.Options etc was just the ticket - much simpler than all the API calls.
 

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