How I read/write on registry with VBA? 
Author Message
 How I read/write on registry with VBA?

Hello all,

I need to access on registry with a Outlook Form and I don't know how I
can to access this.

Can you help me please ?

Thanks very much.

Claudio

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!



Sun, 06 Jun 2004 18:23:09 GMT  
 How I read/write on registry with VBA?
An Outlook form can only use VBScript code, which can't use Declare
statements to access the Windows registry API functions. Nor can it
use the VBA registry functions, which only can access a few locations.

What you should use is Windows scripting for that. It can be used in
VBScript. Here is a sample Sub that uses it to get the registry value
containing the name of the computer the code is being run on:

Sub ReadRegistryValue()
Dim WshShell
Dim strValue
Dim strKey

Set WshShell = CreateObject("Wscript.Shell")
strKey = "HKCU\Software\Microsoft\Office\9.0\"
strKey = strKey & "Outlook\Machine Name"
strValue = WshShell.RegRead(strKey)
MsgBox strValue
End Sub

--
Ken Slovak
[MVP - Outlook]
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning Visual Basic 6 Application Development, Wrox
Press


Quote:
> Hello all,

> I need to access on registry with a Outlook Form and I don't know
how I
> can to access this.

> Can you help me please ?

> Thanks very much.

> Claudio

> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



Sun, 06 Jun 2004 22:25:05 GMT  
 How I read/write on registry with VBA?
try this :
---------
Dim WshShell, bKey

Set WshShell = CreateObject ("WScript.Shell")
WshShell.RegWrite "HKCU\Software\ACME\","hendy","REG_SZ"
bKey = WshShell.RegRead("HKCU\Software\ACME\hendy")

another way...
you make a VB Dll that has SaveSetting and GetSetting
methods...inside VB you can use VB SaveSetting and
GetSetting...then compile it into Registry.dll (for
example)..

and then from Outlook form (script)..you can code
set ReadReg = CreateObject("Registry.Access")

Quote:
>-----Original Message-----
>Hello all,

>I need to access on registry with a Outlook Form and I
don't know how I
>can to access this.

>Can you help me please ?

>Thanks very much.

>Claudio

>*** Sent via Developersdex http://www.developersdex.com
***
>Don't just participate in USENET...get rewarded for it!
>.



Fri, 18 Jun 2004 11:57:28 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Writing a VBS file which reads and writes to the registry

2. reading and writing to the registry

3. Reading & writing the registry

4. Class to Read/Write any Registry key

5. Read or Write to Registry

6. Help: read or write to the registry

7. Registry read/write

8. How can I Read-Write the registry from a VBScript-Procedure of an outlook-form

9. How can I Read-Write remote registry

10. Reading/Writing to the Registry and .INI file???

11. How to read/write a key to the registry

12. Read From and Write To Registry

 

 
Powered by phpBB® Forum Software