Edit text document
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 235   1
URL.หัวข้อ / URL
Edit text document

ถามไว้ที่ 
http://board.quicktechusa.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=002351#000001 
 
ดังนี้ 
I need to pull up a text document for the user to view and possibly edit if  
needed.... I was curious about the best way to do that and how. I was thinking if  
there was an activex control that i could just put it up in and let them edit that  
would probably be easiest..or i may have to import the text to a memo field and  
then update the text file after changes are made... but i wouldn't know how to do  
either one... 
 
TIA 
Bryan F.  
 
ต้องการเรียกไฟล์ Text มาดูใน Access และถ้ามีการแก้ไขก็ให้ Save ได้ด้วย 
 
ผมเลยให้โค้ดนี้เขาไป โดยสร้างปุ่มขึ้นมา 2 ปุ่ม ใช้ดึงข้อความมาดู และอีกปุ่มหนึ่งใช้ในการบันทึกการแก้ไข ดังนี้ครับ 
 
Private Sub cmdGetText_Click() 
Dim objFile As Object, objText As Object 
Set objFile = CreateObject("Scripting.FileSystemObject") 
Set objText = objFile.OpenTextFile("C:\modFieldType.txt") 
Me.Text0 = objText.ReadAll 
End Sub 
 
Private Sub cmdSave_Click() 
Dim strData As String 
Dim strFile As String 
 
strFile = "C:\modFieldType.txt" 
 
Open strFile For Output As #1 
     
strData = Me.Text0 
Print #1, strData 
 
Close #1 
End Sub 

1 Reply in this Topic. Dispaly 1 pages and you are on page number 1

1 @R06626
   
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.0542s