VB GetSetting, what is the "Section" and What is the "Key" value. - URGENT

Posted on 2005-04-15
Last Modified: 2013-12-26
I had to ask this because I have not worked with this functionality before and I don't have time to play and figure it out.  I am using a WIndows API call version of the .NET GetSetting function to pull a registry value.  The code still uses the same variables ad the basic GetSetting function but of course allows to to pull from HKEY_LOCAL_MACHINE instead of the practically useless VB key.  SO here is my dumb yet very urgent question.

I need to Figure out if a machine is running M$ Office XP or Office 2k3.  So I need to know which of the following regisrty keys Exists

HKEY_LOCAL_MACHINE\SOFTWARE\Company\ImageBuilder\ApplicationInstallations\Microsoft Word 2003 with SP1 - for 2k3


HKEY_LOCAL_MACHINE\SOFTWARE\Company\ImageBuilder\ApplicationInstallations\Microsoft Office XP Standard - for XP

ok, here's the stupid part.... ready.... promise not to laugh at me

in my variables I am assuming appname is WinWord.exe, because that is the executeable, is this wrong?

What would the Section value be? - \Company\ImageBuilder\ApplicationInstallations\???

And what is the key value?  

it's early, I am overworked and underpaid, so please be nice :-).  Thanks
Question by:Wonderflub
    LVL 10

    Expert Comment

    You can't do this with GetSetting/SetSetting.

    Check out rdWillet's answer here (and give him/her) the points
    LVL 14

    Expert Comment

    by:Shiju Sasidharan
    using this
    SaveSetting "MyApp","Startup", "Left", 50

    u can save entries in the key

    HKEY_CURRENT_USER\Software\VB and VBA Program Settings\MyApp

    thats all
    LVL 14

    Expert Comment

    by:Shiju Sasidharan
    using GetSetting ,
    u can retrieve only the value u set using SaveSetting
    LVL 14

    Expert Comment

    by:Shiju Sasidharan
    that is u can use the section "Startup" to get it back
          GetSetting( "MyApp", "Startup", "Left", "25")
    LVL 85

    Expert Comment

    by:Mike Tomlinson
    Are you using VB6 or VB.Net?

    If VB6 then here is another approach:

    Author Comment

    ok, perhaps I was not clear.... let me try again... I am not using the getSetting function, I am using code written with API calls that uses the same variables as the getsetting function.  I don't need to know how to do it, I jsut need to know what the value of AppName, Section, and Key, that's all, just what I would enter as the values.  ie. of hte reg key
    HKEY_LOCAL_MACHINE\SOFTWARE\Company\ImageBuilder\ApplicationInstallations\Microsoft Word 2003 with SP1
    what would I enter as the section?
    LVL 8

    Accepted Solution

    appname: HKEY_LOCAL_MACHINE\SOFTWARE\Company\ImageBuilder\ApplicationInstallations
    section: Microsoft Word 2003 with SP1
    key: the entry under the section
    Value: the value of the key
    LVL 4

    Expert Comment

    Can you post the actual key and all the values under the key: HKEY_LOCAL_MACHINE\SOFTWARE\Company\ImageBuilder\ApplicationInstallations
    The example  fds_fatboy references above that I gave will read any registry key.  As to what names to use: I ask you to post your actual registry so that I can give u a complete example.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    730 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

    15 Experts available now in Live!

    Get 1:1 Help Now