Open an Exel file(exel) and a Text file(txt) in Catia
Open an Exel file(exel) and a Text file(txt) in Catia
(OP)
CODE --> VBScript
Sub CATMain()
Set objNote = CreateObject("Scripting.FileSystemObject"): 'objNote.Visible = true
Set objNotepad = objNote.OpenTextFiles.Open("D:\test.txt")
Set objExcel = CreateObject("Excel.Application"): objExcel.Visible = true
Set objWorkbook = objExcel.Workbooks.Open("D:\test.xls")
End Sub I made this script for opening an Exel file(xls) and a Text file(txt).
But it opens only Exel file not Text file.
How can I open a Text file in Catia like opening an Exel file?





RE: Open an Exel file(exel) and a Text file(txt) in Catia
CODE --> CATScript
' ====================================================== ' Purpose: Macro will open a TXT file found in C:\Temp\ folder with NOTEPAD from an active CATIA session ' Usage: 1 - A CATIA session must be active ' 2 - Run macro ' Author: ferdo (Disclaimer: You use this code at your own risk) ' ====================================================== Sub CATMain() Dim objShell Set objShell = CreateObject("WScript.Shell") If MsgBox("Would you like to open the text file found in C:\Temp\testfile.txt?", vbYesNo) = vbYes then objShell.Run("notepad " & "C:\Temp\testfile.txt") End If End SubRegards
Fernando
https://picasaweb.google.com/102257836106335725208 - Romania
https://picasaweb.google.com/103462806772634246699... - EU
RE: Open an Exel file(exel) and a Text file(txt) in Catia
That is what I want!!
I got the "opentextfile"is totally wrong.
You do save me!! :)