Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    UK, Surrey
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting User Info (Word 97/2000)

    I am a doctor, working in an office, dealing with incidents in the community. I work with a few other doctors and nurses. We keep records using Word, so that any of us can pick up records, see what has happened previously, and add new notes as, for example, more information comes in. To keep a record of the calls, I have written a macro which inserts the user's name, date, and time into a document with a single button-click.

    The macro I've created adds the document author, which is fine if the person editing the document is listed as the author. I can edit the macro to change the author name, but then each user has to have their own version of the macro.

    I would like it to look up the "User" name - the name which appears in new Word documents, and which you can alter by editing the "User Information" (Tools|Options), but I cannot seem to find a way of doing this using the built in help functions. Help, please!

    TIA, Peter English.
    __

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting User Info (Word 97/2000)

    You also need to handle the case of A entering the info using B's computer.

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting User Info (Word 97/2000)

    How about Application.UserName ?
    Francois

  4. #4
    Star Lounger
    Join Date
    Jan 2001
    Location
    UK, Surrey
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting User Info (Word 97/2000)

    Thanks, Howard. Using the network, the user info and setup is taken from the network, so that isn't an issue on this occasion - unless people don't log out and back in as themselves. I agree that it could be an issue on occasions, but I think, for us, we can manage without building that in. If we did decide to do this we could, I suppose, set a user variable, which people can change when they start to use the computer.

    Your point has made me think of a cludge I could have used: to get the normal.dot autoexec macro to create a new document, look to see who the author was, and set that as a variable which could be used instead of the author when editing a document started by somebody else... Thanks for stimulating that thought!

    I'll try Francois's suggestion first.

    Peter.

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Location
    UK, Surrey
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting User Info (Word 97/2000)

    Dank u well!

    I now have the macro:

    Sub NameDateTime()
    Selection.MoveDown Unit:=wdLine, Count:=1
    Selection.TypeText Text:=Application.Username
    Selection.InsertDateTime DateTimeFormat:=", dd/MM/yy HH:mm", InsertAsField:= _
    False
    Selection.TypeParagraph
    Selection.MoveUp Unit:=wdLine, Count:=1
    Selection.Paragraphs.OutlinePromote
    Selection.MoveDown Unit:=wdLine, Count:=1
    End Sub

    which works perfectly.

Posting Permissions

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