Results 1 to 6 of 6
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    any code to change registry values (word97 sr2b)

    Hi

    Does anyone have existing code to edit & change settings in the registry?

    many thanks
    Diana

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: any code to change registry values (word97 sr2b)

    Diana,

    Take a look at the Word VBA Help topic: "PrivateProfileString Property" - you can use this to get and set values in either text files or in the registry.

    Gary

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: any code to change registry values (word97 sr2b)

    (Edited by HansV to activate URL - see <!help=19>Help 19<!/help>)

    Hi Gary

    I've looked on MSDN to get sample code for registry at
    http://msdn.microsoft.com/library/default....atoregistry.asp
    & of course I cant get it to work.

    I'll give your suggestion ago!
    cheers Diana

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: any code to change registry values (word97 sr2b)

    Hi Diana,

    If you look closely at the MSDN article you refer to, you will see that it is Visual Basic 2003 code. Visual Basic 2003 is part of Visual Studio .Net. Microsoft's "next generation" of development tools. You can't expect that code to work in Word 97 VBA, which is based on Visual Basic 5. But, as Gary pointed out, Word VBA has built in tools to read and write the registry.

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: any code to change registry values (word97 sr2b)

    Diana,
    Here's a handy dandy little class mod I wrote that utilizes the WScript.Shell registry methods. I prefer the Windows level functionality to the VBA in some cases (filesystemobject also comes to mind). See if you can adapt this to your needs. Be sure to change the file ext. to .cls before importing it into the VBE.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  6. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: any code to change registry values (word97 sr2b)

    kevin

    thanks for that. I'll have a look & make some modifications & see how it goes.
    cheers Diana

Posting Permissions

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