Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Boston, Massachusetts, USA
    Posts
    205
    Thanks
    0
    Thanked 0 Times in 0 Posts

    macro points to username (Word XP Sp2)

    I have a macro that points to a template in the startup location for Word. This has always worked fine, except that we need to now change the startup path for citrix to point to c:documents and settings%username%application datamicrosoftwordstartup. When I attempt to use the username variable, I am getting an error message. How can I fix the following code to work for with the variable username?

    If fsGetVariableValue("letterformat") = "Personal" Then

    Selection.HomeKey unit:=wdStory

    Templates("Cocuments and Settings%username%Application DataMicrosoftWordStartupSWFirm.DOT").AutoTextEntri es("Writer").Insert _
    Where:=Selection.Range

    End If

  2. #2
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: macro points to username (Word XP Sp2)

    Templates("Cocuments and Settings" & environ("username") & "Application DataMicrosoftWordStartupSWFirm.DOT").AutoTextEntri es(...

    both this solution and the api solution are at get username

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Boston, Massachusetts, USA
    Posts
    205
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: macro points to username (Word XP Sp2)

    Thanks! Worked like a charm!

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: macro points to username (Word XP Sp2)

    How about:

    Application.StartupPath &
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Brussels, Brussel, Belgium
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: macro points to username (Word XP Sp2)

    nice out-of-the-box thinking! <img src=/S/groovin.gif border=0 alt=groovin width=21 height=21>

Posting Permissions

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