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
[email protected]
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.
 
Top