Delete in Registry

U

Ulf Nilsson

Hi,
I add the key by using:
System.PrivateProfileString
(Empty, "HKEY_CURRENT_USER\Software\Apps\AV_Word", "Settin
gs") = "ABC"

How do I delete this key in the registry? I do not just
want to set it to empty.

I have tried DeleteSetting, but it does not seem to work
for me.

/ Ulf
 
W

Word Heretic

G'day "Ulf Nilsson" <[email protected]>,

The VBA Developer's Handbook by Ken Getz et al has loads of stuff on
this.


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Ulf Nilsson reckoned:
 
J

Jonathan West

Hi Ulf,

There is nothing in the built-in commands in VBA that will do this. The
System.PrivateProfileString property won't delete keys, and the SaveSetting,
DeleteSetting command sonly work on a small area of the registry

You can use Karl Peterson's RegSettings code available from
http://vb.mvps.org/samples/project.asp?id=RegSettings

This module provides an equivalent of DeleteSetting etc but which can be
applied to any key amd not just the ones within the area that the built-in
commands can access.

It was written in VB rather than VBA, but don't worry, you can drop the
CRegSettings.cls class module straight into your Word VBA project and it
will work.
 
W

Word Heretic

G'day "Ulf Nilsson" <[email protected]>,

Very long and available in a book for purchase. If you would care to
pay me I might give more of one...


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Ulf Nilsson reckoned:
 
U

Ulf Nilsson

Thanks!

/ Ulf

-----Original Message-----
Hi Ulf,

There is nothing in the built-in commands in VBA that will do this. The
System.PrivateProfileString property won't delete keys, and the SaveSetting,
DeleteSetting command sonly work on a small area of the registry

You can use Karl Peterson's RegSettings code available from
http://vb.mvps.org/samples/project.asp?id=RegSettings

This module provides an equivalent of DeleteSetting etc but which can be
applied to any key amd not just the ones within the area that the built-in
commands can access.

It was written in VB rather than VBA, but don't worry, you can drop the
CRegSettings.cls class module straight into your Word VBA project and it
will work.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top