Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Registry Question

Posted on 2000-02-23
2
Medium Priority
?
137 Views
Last Modified: 2010-05-02
How do I programmatically add a key to the "VB and VBA Program Settings" key?  Please provide the code that will perform this task.
0
Comment
Question by:jasonboetcher
2 Comments
 
LVL 3

Accepted Solution

by:
paulstamp earned 45 total points
ID: 2550870
This is an example from my clsPreferences used to record settings in the registry

Public Property Let AlwaysConnect(ByVal bValue As Boolean)
    Call SaveSetting(m_sAppName, "Prefs", "AlwaysConnect", bValue)
   
End Property

Public Property Get AlwaysConnect() As Boolean

    AlwaysConnect = GetSetting(m_sAppName, "Prefs", "AlwaysConnect", "True")
   
End Property
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2550875
Use the VB SaveSetting statement like this:

SaveSetting Statement Example
The following example first uses the SaveSetting statement to make entries in the Windows registry (or .ini file on 16-bit Windows platforms) for the MyApp application, and then uses the DeleteSetting statement to remove them.

' Place some settings in the registry.
SaveSetting appname := "MyApp", section := "Startup", _
            key := "Top", setting := 75
SaveSetting "MyApp","Startup", "Left", 50
' Remove section and all its settings from registry.
DeleteSetting "MyApp", "Startup"
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question