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

    File In Use By... (Word 97SR2)

    If Word tries to open a file in use, it will tell you (as shown in an afore posted dialog window and posted again here for your convenience) the name of the user who has it open.

    I'd like to replicate that behavior. I know I can look for then open the temp placeholder file ~$restOfFileName.doc and read the name into a var and there you have it.

    The question: by what method do I locate the temp file? I know it's always in the same folder as the original; I know it starts with "~$"; I also know it's a hidden file. But how is the file name constructed? It looks like if the filename is "short " (6 chars or less??), the ~$ is appended to the front of the name:

    Test.doc becomes ~$Test.doc

    But if the name is long (> 6 chars?) the first two chars of the name are lopped off and replaced with the ~$. Is this a correct assumption?

    Is there a better way to get the name of the user?
    Attached Images Attached Images
    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>

  2. #2
    Lounger
    Join Date
    Nov 2001
    Location
    Fort Dodge, Iowa, USA
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: File In Use By... (Word 97SR2)

    Have you considered simply checking to see if filename contains characters 2 through 8 of the original filename, regardless of extension?

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

    Re: File In Use By... (Word 97SR2)

    Chris,
    Thanks for the reply.

    I've settled on this code:

    If Len(strName) <= 6 Then
    strName = "~$" & strName
    Else
    strName = "~$" & Mid$(strName, 3)
    End If

    Look ok to you?
    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
  •