XPost: microsoft.public.vb.general.discussion, microsoft.public.vb   
   From: dsarvas@yahoo.com   
      
   On Sun, 14 Sep 2008 14:14:07 -0400, "expvb" wrote:   
      
   >"expvb" wrote in message   
   >news:uJXjLUpFJHA.616@TK2MSFTNGP06.phx.gbl...   
   >> "Don" wrote in message   
   >> news:48cd4c0a.2185703@news.west.cox.net...   
   >>> I'm assuming you mean that Notepad can be used to open a file with   
   >>> exclusive access.   
   >>   
   >> Not sure what you mean, but if you open the file exclusively, like the   
   >> following, Notepad can't even read it:   
   >>   
   >> Option Explicit   
   >>   
   >> Dim f As Long   
   >>   
   >> Private Sub Command1_Click()   
   >> f = FreeFile   
   >> Open App.Path & "\Test.txt" For Binary Access Read Write Lock Read Write   
   >> As f   
   >>   
   >> End Sub   
   >>   
   >> Private Sub Command2_Click()   
   >> Close f   
   >   
   >I forgot to add the following line here, so the file number is not closed   
   >again in Form_Unload:   
   >   
   >f = 0   
   >   
   >> End Sub   
   >>   
   >> Private Sub Form_Unload(Cancel As Integer)   
   >> If f <> 0 Then   
   >> Close f   
   >> End If   
   >> End Sub   
   >>   
   >>   
      
   This is how I've set up my apps in the past to read and work with   
   files and this would work, but it's what I wanted to avoid. I wanted   
   users to be able to work with whatever is the default app for .txt   
   files. Notepad is pretty much the overwhelming default app and one   
   that closes the file too quickly.   
      
   So I will probably go back to exactly what you are suggesting above or   
   create a detour to another app I konw they have on their system that   
   will open a text file and keep the file open.   
      
   My hope to find a way to do this allowing Notepad to retrieve the file   
   just ain't gonna happen I guess.   
      
   By the way, I generally close text files immediately just like Notepad   
   when a user uses my apps to read a file. I see the pros, but now I   
   also see the cons.   
      
   Don   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|