Forum: สอบถามปัญหา Notes ทางด้านพัฒนาโปรแกรม (Note Client) |
Tags1: | Created on Sep 25, 2008, 1:31 PM by 9notes/9Notes|Topic Responses: 10 |
&action=openDocument&documentId=2F26 |
วิธีก่อนหน้านี้ที่ผมนำเสนอคือผมไม่แน่ใจว่าคุณ Geosphere มี richtext file ทีเป็นรูปปนกันกับตารางด้วยหรือเปล่าเลยทำการ Abstract เพื่อถอดให้เหลือแต่ text file ก่อนครับแล้วค่อยอ่านออกมาอีกทีแต่ก็ติดข้อจำกัดเรื่อง limitation ของฟิลด์ วิธีนี้ถ้าข้อมูลไม่มากก็พอไหวครับ
อันนี้เป็นอีกวิธีหนึ่ง ผมอ่านจาก richtext field มาก่อนแล้ว write ออกไปเป็น text file แบบนี้จะได้ format ที่มีขึ้นบรรทัดใหม่เหมือนต้นฉบับมาเลย จากนั้นก็อ่านไฟล์เข้ามาทีละบรรทัดแล้วเก็บเข้า array ครับ
Dim db As NotesDatabase
Dim s As New NotesSession
Set db = s.CurrentDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument
Dim rtitem As NotesRichTextItem
Set rtitem = doc.GetFirstItem("Body")
If ( rtitem.Type = RICHTEXT ) Then
plainText = rtitem.GetFormattedText( False, 0 )
End If
Dim text As String, fileNum As Integer
' get a file number for the file
fileNum = Freefile
' open the file for appending
Open "c:\plane.txt" For Append As fileNum
' write the formatted text to the file
Print #fileNum, plainText
' close the file
Close #fileNum
Dim arraylist() As String
Dim count As Integer
fileNum% = Freefile()
Open "c:\plane.txt" For Input As fileNum%
count = 0
Do While Not Eof(fileNum%)
Line Input #fileNum%, text$
Print text$ ' Prints one line of config.sys
Redim Preserve arraylist(count)
arraylist(count) = text$
count = count + 1
Loop
:yellow_cool.gif: |
|