Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2011
    Posts
    63

    Unanswered: Open PDF,.Doc Files in Read Only

    Hi there,

    I am able to use Application.FollowHyperlink to open files on the network drive but I wan't it to be read only. For example, if they open a Word Document I don't want them to edit anything and save the file. I can't make folder permissions for read/write access because the users need to be able to upload files.

    To sum it up; the users need to upload files and then only be able to view those files after upload. Is this possible?

    Here is the "File Upload" code (it's a filecopy)
    Code:
    Dim FileName As String
        Dim FileLocation As String
        Dim UploadLocation As String
        
        'Retrieve the file's information
        FileName = Me.tbFileName
        FileLocation = Me.tbFile
        UploadLocation = [Forms]![frmCreateReport]![subfrmPlanAudit].[Form]![FileLocation] + "\" + FileName
        
        'Copy the file into the audit's directory
        Set oFileSys = CreateObject("Scripting.FileSystemObject")
        FileCopy FileLocation, UploadLocation
    Here's a quick snippet to open the file
    Code:
    strDocName = "C:\Documents and Settings\phamt\My Documents\Checklist.doc"
    Application.FollowHyperlink strDocName
    Thanks!

  2. #2
    Join Date
    Jul 2011
    Posts
    63

    Talking

    Problem Solved

    Code:
    Set oFileSys = CreateObject("Scripting.FileSystemObject")
        FileCopy FileLocation, UploadLocation
        SetAttr UploadLocation, vbReadOnly

Posting Permissions

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