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

Re: Delete in Registry by Word

Word
Mon Feb 21 20:32:46 CST 2005

G'day "Ulf Nilsson" <anonymous@discussions.microsoft.com>,

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:

>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


Re: Delete in Registry by Ulf

Ulf
Tue Feb 22 02:15:44 CST 2005

And the answer is ...

/ Ulf

>-----Original Message-----
>G'day "Ulf Nilsson"
<anonymous@discussions.microsoft.com>,
>
>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:
>
>>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
>
>.
>

Re: Delete in Registry by Jonathan

Jonathan
Tue Feb 22 04:42:41 CST 2005

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


"Ulf Nilsson" <anonymous@discussions.microsoft.com> wrote in message
news:079301c517fb$6191c360$a501280a@phx.gbl...
> 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
>


Re: Delete in Registry by Word

Word
Tue Feb 22 05:52:49 CST 2005

G'day "Ulf Nilsson" <anonymous@discussions.microsoft.com>,

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:

>And the answer is ...
>
>/ Ulf
>
>>-----Original Message-----
>>G'day "Ulf Nilsson"
><anonymous@discussions.microsoft.com>,
>>
>>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:
>>
>>>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
>>
>>.
>>


Re: Delete in Registry by Ulf

Ulf
Tue Feb 22 05:55:14 CST 2005

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
>
>
>"Ulf Nilsson" <anonymous@discussions.microsoft.com>
wrote in message
>news:079301c517fb$6191c360$a501280a@phx.gbl...
>> 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
>>
>
>.
>