LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How open a .txt file using notepad ?

Using this Vi...

---

25+ years long fan of LabVIEW. Move to Emerson looks to be for the better! See the last posts in subscription model thread.
0 Kudos
Message 11 of 16
(1,470 Views)

This uses .NET to open the text file with the default text editor.

 

Actually, the verb "Print" makes it print. If you make it empty, the file will open.

 

This works for any file (pdf, doc, VI, etc.).

 

Print.png

Message 12 of 16
(1,460 Views)

Nice, Implemented something like that using the command line for other file types but this is much cleaner 🙂

Forgot to add to my implementation (can't find a way to edit my post), tries to open with notepad++ and falls back to notepad.exe.

Just wondering.. I assume the .net implementation use the file extension to determine application? In that case it will only work when the extension & type have been registered?

---

25+ years long fan of LabVIEW. Move to Emerson looks to be for the better! See the last posts in subscription model thread.
0 Kudos
Message 13 of 16
(1,457 Views)

@beuvink wrote:

Just wondering.. I assume the .net implementation use the file extension to determine application? In that case it will only work when the extension & type have been registered?


Yes, it uses the registered application for the extension.

 

This can be good or bad, depending on what you want of course...

 

There's also an API call for it, but .NET is often a lot easier...

0 Kudos
Message 14 of 16
(1,450 Views)

The API call is ShellExecute()

 

The Windows Shell32 is in fact a layer on top of the actual Win32 API and is for a large part simply all combined functionality from Explorer and old style IE Explorer collected together. Most of the actual functionality is internally build around COM classes with exported function wrappers to the most common functions that an application could use. To get access to the full functionality however it is pretty unavoidable to use the COM interfaces.

 

Explorer itself is just a really thin executable shell around that layer as all the actual functionality sits in Shell32. LabVIEW almost exclusively interfaces to the low level Win32 API and does very little with the shell layer at all.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 15 of 16
(1,437 Views)

Try this.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 16 of 16
(1,420 Views)