Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How do i read from an already opened Notepad file

[b][grey]How do i read from an already opened text file using vb6.0..
The said fiel is already open by another application in append mode..
and we are to reead the contents of the opened file.
I tried to write code which is here...[/grey][/b]
[code][blue]
Private Sub Form_Load()

Dim TxtSheet As Object

Set TxtSheet = GetObject("d:amit1.txt")
' This is a NOTEPAD APPLICATION AND IS ALREADY OPENED


Dim buffer As String
buffer = TxtSheet.Application.Value
Text1.Text = buffer

Unload Me

End Sub
[/blue][/code]
[red]
Thanks and Regards:
Amit
[/red]

Comments

  • JomacJomac Member Posts: 231
    : [b][grey]How do i read from an already opened text file using vb6.0..
    : The said fiel is already open by another application in append mode..
    : and we are to reead the contents of the opened file.
    : I tried to write code which is here...[/grey][/b]
    : [code][blue]
    : Private Sub Form_Load()
    :
    : Dim TxtSheet As Object
    :
    : Set TxtSheet = GetObject("d:amit1.txt")
    : ' This is a NOTEPAD APPLICATION AND IS ALREADY OPENED
    :
    :
    : Dim buffer As String
    : buffer = TxtSheet.Application.Value
    : Text1.Text = buffer
    :
    : Unload Me
    :
    : End Sub
    : [/blue][/code]
    : [red]
    : Thanks and Regards:
    : Amit
    : [/red]
    :
    :

    Generally I file is locked when it is opened from appending.
    ______
    [size=2][b][blue]J[/blue]omac.[/b][/size]

Sign In or Register to comment.