Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    May 2004
    Location
    St. John, Virgin Islands, USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    User name change? (XPHome 5.1.6200)

    I have a problem in that I have a user name of Rudy on my office computer and Rudy Patton on my home computer. This only gives me problems when I write a macro in Word or Excel and transport the files to from one computer to another. I have to go into each and change the Rudy to Rudy Patton on the file location. Can I change the name or migrate my settings from "Rudy Patton" to a new name "Rudy?"

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

    Re: User name change? (XPHome 5.1.6200)

    If you were to change the name using the Control Panel, User Accounts , Yes, it will change the log in name but will NOT change the folder name under Documents and settings.

    The only GOOD way of doing this is to make a new account with the name that you want. Make ALL of the changes you need including setting up your email accounts. You then will need to copy ALL files (My Documents and My Pictures) to the new account. Do NOT try and move any of the system folders as they retain the original ownership. Then you can import your email and address book, copy or move your Favorites.

    This is going to be a lot of work for this. I did NOT know that macros were limited to the use by one account.

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

  3. #3
    New Lounger
    Join Date
    May 2004
    Location
    St. John, Virgin Islands, USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: User name change? (XPHome 5.1.6200)

    When the macro includes inserting a file (like a jpeg) it does require the correct location of the file - I guess I could move them to a folder not in My Documents on both computers.

  4. #4
    Platinum Lounger
    Join Date
    Jan 2001
    Posts
    3,788
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: User name change? (XPHome 5.1.6200)

    Rather than hard coding file paths take a look at the default file path options available within Word & Excel. For example the following lines of code result in a message box telling you the default file path for documents which by default will be the My Documents folder for whatever user is logged on.

    Word
    <pre>MsgBox "The current default file path is " & Options.DefaultFilePath(wdDocumentsPath)</pre>


    Excel
    <pre>MsgBox "The current default file path is " & Application.DefaultFilePath</pre>


  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: User name change? (XPHome 5.1.6200)

    You also can retrieve the paths to a few "special folders" using the Windows Script Host:
    <code>
    Sub SpecialFoldersDemo()
    Dim wShell As Object
    Set wShell = CreateObject("WScript.Shell")
    MsgBox "Desktop: " & wShell.SpecialFolders.Item("Desktop") & vbCrLf & _
    "My Documents: " & wShell.SpecialFolders.Item("MyDocuments")
    Set wShell = Nothing
    End Sub</code>

    But it might be easier to create a global constant with the root path for your profile in a module in Normal.dot and refer to that constant in your code, thus making your code portable as long as the constant is present:

    Public Const PROFILE_ROOT As String = "Cocuments and Settingsjscher2000"

Posting Permissions

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