Results 1 to 6 of 6
  1. #1
    michielmarchau
    Guest

    Word 2000 - network

    I frequently have to access a word-template on a shared network directory which is password-protected. How can I program this in VBA so I do not have to type the password myself each time. I know it has something to do with system.connect but do not know the finessess about it.

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

    Re: Word 2000 - network

    You can use System.Connect or an API call to "map" network resources. The syntax for System.Connect is disclosed in the VBA help example:

    System.Connect Path:="ProjectInfo", Password:="smiley"
    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>

  3. #3
    michielmarchau
    Guest

    Re: Word 2000 - network

    Thanks for your prompt answer (I posted it not an hour ago).

    Do you need to "disconnect" also or does this connection closes after the document has been accessed or downloaded?

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

    Re: Word 2000 - network

    The mapped drive stays mapped until you unmap it or exit Windows. Also, the .connect method "overwrites" a previous connection to an existing mapped drive letter. If you need greater flexibility, you have to use the WinNetAPI call "WNetAddConnection2". There's also a WNetAddConnection3, I think, for EVEN GREATER flexibility. MS sure is flexible, huh?
    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>

  5. #5
    Super Moderator
    Join Date
    Dec 2000
    Location
    Renton, Washington, USA
    Posts
    12,560
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Re: Word 2000 - network

    The inbedding a password may be a violation of Company rules and you could lose your job. Things are passworded for a reason. Check with your IT support befor running this. Think about your job over a little password.

    Now running HP Pavilion a6528p, with Win7 64 Bit OS.

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

    Re: Word 2000 - network

    If the template is of a high-security nature then, by all means, don't risk your job. If not, why not just move the template to a folder not password protected?
    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>

Posting Permissions

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