I found what I wanted by Jon Summers, but the link will not take you anywhere it errors out. It appeared just what I was looking for
If you do a keyin the %
Manual KeyIns work like: %"C:\Text_C\Text MicroStation\MouseWheelSettings.txt"
Sub Jiri01()Dim RetValRetVal = Shell("C:\WINDOWS\notepad.exe ", 1)ShowStatus "Open Notepad"End Sub
But if you try the same thing from within VBA it will error out, been working for days on this simple thing.
even found the following , which did not work either!!
railab2008 said: Maybe there is another way for opening text files?
There's another way to open files of any type from VBA.
This article describes Windows File Associations, and a utility that you can call from VBA to open a document using its associated application. That is, you can open a Word, Excel, Text or whatever document.
Regards, Jon Summers LA Solutions
Just ran this in MicroStation CE VBA without any issues.
Even though I called it OpenNotepad, if I remember correctly this will open the file with whatever the default application is for the file extension.
Sub OpenNotepad() Dim fso As Object Dim sfile As String Set fso = CreateObject("shell.application") sfile = "C:\Temp\SOLabelPoint.txt" fso.Open (sfile) End Sub
What do you want to do AFTER opening the txt file using vba? If you don't need the vba code do anything further than just opening the txt file, you could just mimic a keyin in vba:
cadinputqueue.SendKeyin "%" & chr(34) & "C:\Text_C\Text MicroStation\MouseWheelSettings.txt" & chr(34)
the chr(34) bit is optional if there's no "space" in your path
Answer Verified By: Robert Hook
Fantastic solution, I am using it all the time. So appreciate your taking the time to solve my problems.
This is the simplest and easiest I have see.
Version: MicroStation V8i SS 10
RJB Phillips III (Richard) Praise the Lord for His Mercy and grace in Christ Jesus