Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Want to read from an already opened Notepad file

Want to read from an already opened Notepad file

Scheduled Pinned Locked Moved Visual Basic
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amitranjanmishra
    wrote on last edited by
    #1

    How do i read from an already opened text file using vb6.0.. I tried to write code which is here... Private Sub Form_Load() Dim TxtSheet As Object Set TxtSheet = GetObject("d:\amit\1.txt") ' This is a NOTEPAD APPLICATION AND IS ALREADY OPENED by some other application in write|append mode Dim buffer As String buffer = TxtSheet.Application.Value Text1.Text = buffer Unload Me End Sub amit mishra

    D 1 Reply Last reply
    0
    • A amitranjanmishra

      How do i read from an already opened text file using vb6.0.. I tried to write code which is here... Private Sub Form_Load() Dim TxtSheet As Object Set TxtSheet = GetObject("d:\amit\1.txt") ' This is a NOTEPAD APPLICATION AND IS ALREADY OPENED by some other application in write|append mode Dim buffer As String buffer = TxtSheet.Application.Value Text1.Text = buffer Unload Me End Sub amit mishra

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Notepad just edits text files. Are you talking about opening and reading the file, or are you trying to the the contents of the Notepad window? Notepad doesn't put any locks on the files it opens, so use standard file methods to open and read it. Reading the Notepad window will be much more difficult to do in VB because now your trying to read the memory of another process, something that is "mostly" forbidden in Windows. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups