Success! I pasted below a test conversion with a test macro just to see what was actually happening. It roughly shows the present process.
1) Export filenames into a text file. Resulting text file: pdftk "PL1 061219 B.pdf" "PL2 061219 B.pdf" cat output "PL Batch 061219 B.pdf"
2) Rename that text file to a bat file
3) Run that bat file
4) Delete that bat file
5) Done
Re: DoCmd.RunSavedImportExport "Export CA PDF Filenames"
I was hoping this would have been expanded into VBA so I could see how to actually make a text file and change it to making a bat file instead. This is my hang up. I could get rid of a lot of steps if I could use VBA to write to a bat file. Is there sample code that would replace this step where I can specify the filename being exported?
Code:
Function xTest()
On Error GoTo xTest_Err
' frmCountFilesCA
DoCmd.OpenForm "frmCountFilesCA", acNormal, "", "", , acNormal
' frmCountFilesFL
DoCmd.OpenForm "frmCountFilesFL", acNormal, "", "", , acNormal
If (Forms!frmCountFilesCA!FileCount > 0) Then
' Export CA PDF Filenames
DoCmd.RunSavedImportExport "Export CA PDF Filenames"
End If
If (Forms!frmCountFilesCA!FileCount > 0) Then
' Delay
Call Wait(1)
End If
If (Forms!frmCountFilesCA!FileCount > 0) Then
' S:\Orders\CA\RenameTextFile.bat
Call Shell("""\\SVR1\Shared\Orders\CA\RenameTextFile.bat""", 1)
End If
If (Forms!frmCountFilesCA!FileCount > 0) Then
' S:\Orders\CA\CH_PackingList_Rename.bat
Call Shell("""\\SVR1\Shared\Orders\CA\CH_PackingList_Rename.bat""", 1)
End If
If (Forms!frmCountFilesCA!FileCount > 0) Then
' S:\Orders\CA\DeleteTextFile.bat
Call Shell("""\\SVR1\Shared\Orders\CA\DeleteTextFile.bat""", 1)
End If
If (Forms!frmCountFilesFL!FileCount > 0) Then
' Export FL PDF Filenames
DoCmd.RunSavedImportExport "Export FL PDF Filenames"
End If
If (Forms!frmCountFilesFL!FileCount > 0) Then
' Delay
Call Wait(1)
End If
If (Forms!frmCountFilesFL!FileCount > 0) Then
' "S:\Orders\Commerce Hub FL Oubound Orders\RenameTextFile.bat"
Call Shell("""\\SVR1\Shared\Orders\Commerce Hub FL Oubound Orders\RenameTextFile.bat""", 1)
End If
If (Forms!frmCountFilesFL!FileCount > 0) Then
' "S:\Orders\Commerce Hub FL Oubound Orders\CH_PackingList_Rename.bat"
Call Shell("""\\SVR1\Shared\Orders\Commerce Hub FL Oubound Orders\CH_PackingList_Rename.bat""", 1)
End If
If (Forms!frmCountFilesFL!FileCount > 0) Then
' "S:\Orders\Commerce Hub FL Oubound Orders\DeleteTextFile.bat"
Call Shell("""\\SVR1\Shared\Orders\Commerce Hub FL Oubound Orders\DeleteTextFile.bat""", 1)
End If
If (Forms!frmCountFilesCA!FileCount > 0) Then
' frmCountFilesCA
DoCmd.Close acForm, "frmCountFilesCA"
End If
If (Forms!frmCountFilesFL!FileCount > 0) Then
' frmCountFilesFL
DoCmd.Close acForm, "frmCountFilesFL"
End If
xTest_Exit:
Exit Function
xTest_Err:
MsgBox Error$
Resume xTest_Exit
End Function
thanks!