×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Open an Exel file(exel) and a Text file(txt) in Catia

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 
Hello guys,

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

Hi

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 Sub 

Regards
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

(OP)
Thanks a lot!! Ferdo!!

That is what I want!!

I got the "opentextfile"is totally wrong.

You do save me!! :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources