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!!
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.
Dim fso As Object
Dim sfile As String
Set fso = CreateObject("shell.application")
sfile = "C:\Temp\SOLabelPoint.txt"
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
Richard Phillips said:I found what I wanted by Jon Summers, but the link will not take you anywhere it errors out
Is this the link you want?
utility that you can call from VBA to open a document using its associated application.
I am unable to get this particular link to work ?? Do thank you for the reply. Thankfully the 1 at the bottom is working
This 1: Is this the link you want?
Version: MicroStation V8i SS 10
RJB Phillips III (Richard) Praise the Lord for His Mercy and grace in Christ Jesus
Yes, Sir I believe it is and thank you for taking time to show me
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.
I am simply reading them, made a form for quick check on text notes
some on KeyIns, some on VBA Some on settings