- Option Explicit'将数据写入文件Public Sub WriteToFile()
- Dim TextObj As AcadText
- Set TextObj = ThisDrawing.ModelSpace(0)
- Open "C:\ACADText.txt" For Output As #1
- Write #1, TextObj.TextString
- Close #1
- End Sub'从文件读出数据Public Sub ReadFromFile()
- Dim TextObj As AcadText
- Set TextObj = ThisDrawing.ModelSpace(0)
- Dim s As String
- Open "C:\ACADText.txt" For Input As #1
- Input #1, s
- TextObj.TextString = s
- Close #1
- End Sub
|