Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Mar 2006
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Code in a macro that changes a file location (Word 2007)

    Hello

    I am a VBA dabbler and not very good at it but a couple of years ago, I created a letterhead template for my office in Word 2K. It has a macro in it that gets user information from an .ini file which is stored in the users "my documents" folder. The office is now upgrading our hardware and software, so the IT administrators tell me I need to change the location of my .ini file to a network drive. I don't know how to write the code to change the file from the default "my documents" folder to a new network drive folder. Can someone please take a look at the code I have attached and give me some suggestions on how to change the .ini file location. Thanks.
    Attached Files Attached Files

  2. #2
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code in a macro that changes a file location (Word 2007)

    Hello Giulia; Welcome to the Lounge.

    Change:
    strFile = Options.DefaultFilePath(wdDocumentsPath) & "Data.ini"

    To:
    strFile = "Server nameFolder nameSubfolder nameData.ini"

    H.T,H.
    Regards
    Don

  3. #3
    Lounger
    Join Date
    Mar 2006
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code in a macro that changes a file location (Word 2007)

    Thank you very much. That worked!

Posting Permissions

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