Results 1 to 1 of 1

Thread: MS Document Image [Anyone have a clue?]

  1. #1

    Thread Starter
    Addicted Member d.patrick's Avatar
    Join Date
    Nov 2004
    Location
    Oshkosh, WI
    Posts
    172

    Unhappy MS Document Image [Anyone have a clue?]

    Does any one know anything about this control. It seems pretty straight forward to use but I am running into a problem with getting the program to let go of the reference. I display the image, the user gets info from it and then deletes the image from the queue. Here is some code that I have hacked together to show the problem. The original source is far to large to post here. Anyway when I try to delete the file I get an "Access Denied" error. The only thing that I can come up with is that the program still has the file locked but I can't figure out were or how. Any help would be greatly appreciated.

    Code:
    Private tif As New MODI.Document
    Private temp As String
    
    
    Private Sub Command1_Click()
        'Get file with CommonDialog control
        cd.ShowOpen
        temp = cd.FileName
        
        tif.Create temp
        
        'Send image to the Image Viewer
        iv.Document = tif
    
    End Sub
    
    Private Sub Command2_Click()
    Dim fso As New FileSystemObject
    
        tif.Close
        iv.FileName = ""
        Set tif = Nothing
    
        If fso.FileExists(temp) Then
            fso.DeleteFile temp, False
        End If
    
    End Sub
    Last edited by d.patrick; Apr 1st, 2005 at 12:21 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width