Solved

Registry Question

Posted on 2000-02-23
2
127 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 15 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 69

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now