Results 1 to 6 of 6

Thread: DeleteSetting() No API's Please..

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    99

    DeleteSetting() No API's Please..

    How do I programmatically delete the key:

    HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/Ratings

    Using the DeleteSetting() function?

  2. #2
    Fanatic Member
    Join Date
    Jul 2001
    Location
    London UK
    Posts
    671
    You Can't. DeleteSetting() Only allows you to alter the

    HKEY_CURRENT_USER\Software\VB and VBA Program Settings \

    Section

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Mr. Smith is correct.

    The only way you can programmatically delete the key you have specified is by using an API.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Posts
    99
    Ok, thanks for the info. Here's what I am up to. I want use Microsoft Word 97's programming capability (VBA) to delete the registry key I mentioned. Can I do that?

  5. #5
    Fanatic Member
    Join Date
    Jul 2001
    Location
    London UK
    Posts
    671
    Aah, if you are using MS Word then according to http://msdn.microsoft.com/library/de...wdstoreval.asp

    You can set and retrieve information from the Windows registry by using the PrivateProfileString property.

    The PrivateProfileString property has three arguments: FileName, Section, and Key. To return a setting from the Windows registry, the FileName argument must be an empty string (""). The Section name should be the complete path to the registry key. The Key should be the value in the key specified by Section.

    You can also set information in the Windows registry by using the following PrivateProfileString syntax:

    System.PrivateProfileString(FileName, Section, Key) = setting
    I have never used this function and unfortunately this page doesn't state whether you can also delete registry entries, but I suppose you could set them to "" even if you can't.

    For more info also see http://msdn.microsoft.com/library/de...filestring.asp

  6. #6
    gaffa
    Guest
    Or you could use the RegTools5 dll, which is a nice object wrapper round the registry API.

    - gaffa

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width