By Wayne Brill
You may want to output the system variables to a text file. This VB.NET example turns the log file on and runs the SETVAR command. The QAFLAGS setting of 2 enables the command to complete without having to hit Enter multiple times.
<CommandMethod("saveTheVars")> _
Public Sub saveVars()
Dim strLogFileName As String = _
Application.GetSystemVariable("LOGFILENAME")
MsgBox("Varibles saved in " & strLogFileName)
' Setting QAFLAGS to 2 allows you to avoid
' hitting enter multiple times
Application.SetSystemVariable("QAFLAGS", 2)
Application.DocumentManager.MdiActiveDocument _
.SendStringToExecute _
("_.LOGFILEON ", False, False, False)
Dim strCmd As String
strCmd = _
"(command" & """_setvar""" & """?""" & """*""" & ")" _
& vbCrLf
Application.DocumentManager.MdiActiveDocument. _
SendStringToExecute _
(strCmd, False, False, False)
Application.DocumentManager.MdiActiveDocument. _
SendStringToExecute _
("_.LOGFILEOFF ", False, False, False)
End Sub