sorry I did not know you posted...
this will save the positions of the M6's to a text file located in the Mach3 directory, then open it if it finds M6,listing the line number and content on those lines.
Just change the
If ((InStr(linestring,"M6") >0 Or InStr(linestring,"M06")>0)) Then
to M3

Dim currentfile As String
Dim filesys, filetxt, lastline, oldline As String
Dim currentLine As String
Dim dTaskID As Double, path As String, StoreFilePath As String
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set filesys = CreateObject("Scripting.FileSystemObject")
StoreFilePath = CurDir & "\StoredM6.txt"
path = "C:\WINDOWS\notepad.exe"
Set objTextFile = filesys.CreateTextFile(StoreFilePath)
currentLine = GetOEMDRO(816)
Found = False
currentfile = FileName
Set filetxt = filesys.OpenTextFile(currentfile, ForReading, True)
Dim i As Integer
i = -1
j=0
Do While filetxt.AtEndOfStream <> true
linestring = UCase(filetxt.ReadLine()) & " "
If linestring <> " " Then
i = i+1
If ((InStr(linestring,"M6") >0 Or InStr(linestring,"M06")>0)) Then
j = j+1
objTextFile.WriteLine(j & " " & "Line# " & i & " " & linestring)
Found = True
End If
End If
Loop
If Found = True Then
dTaskID = Shell(path + " " + StoreFilePath, vbNormalFocus)
Else
MsgBox "No M6/M06 Found"
End If
filetxt.Close
Set filesys = Nothing
Set filetxt = Nothing
objTextFile.Close