Guten Morgen,
unser DBWorks benutzt ein script zum
Erstellen und Anhängen einer Textdatei
Dieses script enthält einige Programmzeilen, deren Sinn ich in diesem script nicht verstehe und die anscheinend auch nicht notwendig sind. Es funktioniert auch ohne:
set tfolder = fs.GetSpecialFolder(TemporaryFolder)
BomFile = tfolder & "\bom.txt"
Set parameters = createObject("MWScriptGUI.DBWPar")
schema_dir = parameters.parameter("SCHEMA_DIR")
'msgbox schema_dir
Hier das vollständige script:
Sub main()
Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")
Set tfolder = fs.GetSpecialFolder(TemporaryFolder)
BomFile = tfolder & "\bom.txt"
DBWInit(TRUE)
Set parameters = createObject("MWScriptGUI.DBWPar")
schema_dir = parameters.parameter("SCHEMA_DIR")
'msgbox schema_dir
call DBWShell( "CurrentDocument" )
if (okDBW = False) then
exit sub
end if
docIdnospaces = DBWResult( "@DOCUMENT_ID_NOSPACE" ) & _
" " & _
DBWResult( "@DOCUMENT_TYPE" )
docIdSpaces = DBWResult( "@DOCUMENT_ID" )
Doctype = DBWResult( "@DOCUMENT_TYPE" )
DocUid = DBWResult( "@DOCUMENT_UNIQUE_ID" )
DocDir = DBWQueryByUid( DocUid ,DBWLookup( "NAME_FIELD_FILE_DIRECTORY") )
Set WSHS = CreateObject("Wscript.Shell")
newtextfile =DocDir & docIdSpaces & ".txt"
if DBWFileExists( newtextfile ) then
res=MsgBox ("Do you want to view the text file : " & newtextfile ,4)
if res=6 then
WSHS.Run ("notepad " & newtextfile )
end if
exit sub
end if
Set a = fs.OpenTextFile( newtextfile , ForWriting, True )
a.WriteLine( docIdSpaces )
a.close
call DBWShell( "AddDocument " & Replace(newtextfile, " ", "|", 1, -1, 1) & " " & DocUid )
WSHS.Run ("notepad " & newtextfile )
End Sub
Kann mir jemand die Funtion der o.a. Programmzeilen erläutern.?
Danke
Lingemann
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP