Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Brainstorming session for application I am just getting started on.

Status
Not open for further replies.

Mabjro

Programmer
Joined
Jun 3, 2003
Messages
127
Location
US
I am looking for as much feedback as I can get. I am not looking for anyone to do my work for me, but I do not know where to begin.
I want to design an application that will write and execute a batch file. The application will send an AutoCAD.plt file (a file created by printing from AutoCAD to a file) directly to the printer port LPT1.
The way I see this working is that when the user fires up the application, they would first see a screen that shows the directory of .plt files. The user would then have to select the files that they want to send to the printer (LPT1 if local or a network printer) and click print. They would be able to select one at a time or select multiple files while holding down the shift key. When they click print, Access would have to write and execute a batch file with the following syntax;
copy myfile.plt lpt1

Where myfile.plt is the file that was selected for printing. I am pretty sure that for multiple files the syntax could be;
copy myfile1.plt, myfile2.plt, myfile3.plt lpt1.

Does anyone think this is achievable? What topics do I need to look into to make it happen? What objects, methods and properties are going to be key to make this work.

Thank you in advance for your feedback.

Jonathan
 
U may want to check out the shell command. Below is what I do to create and execute a DOS Batch program.

Also look at FileObjects within MS Access. There may be a command to print a file. This may be a better approach than using the DOS approach. Better control of environment and error handling.

Also, there are 3rd Party library products available that could make for a smoother product. I recall having a Autocad viewer tool I integrate with FoxPro Windows many moons ago. I believe it also had a print ability.

htwh,

Steve

'create a directory listing by writing a batch file and executing it
sCommand = "dir " & lcBase_Path & "*.mdb /s /b /o-s >" & APP_PATH & "dir_list_mdb.lst"
Open APP_PATH & "dir.bat" For Output As #1
Print #1, sCommand
Close #1

wHandle = Shell(APP_PATH & "dir.bat")
DelayTime 10 'delay to wait for the directory list, required becasue Shell command is asyncronous.
appLoop wHandle

Open APP_PATH & "dir_list_mdb.lst" For Input As #1 'open the directory list file and load table
Do While Not EOF(1)
'''' Loop through Text File...


Public Function DelayTime(PauseTime As Integer)
Dim start
start = Timer ' Set start time.
Do While Timer < start + PauseTime
DoEvents ' Yield to other processes.
Loop
End Function
Sub appLoop(wHandle As Long)
On Error GoTo errorhandler
Do While 1
AppActivate wHandle, False
Loop
errorhandler:
Exit Sub
End Sub

Steve Medvid
&quot;IT Consultant & Web Master&quot;

Chester County, PA Residents
Please Show Your Support...
 
Thank you smedvid. Your reply may be one piece of the puzzle. I will have to toy with it.

Does anyone else have any suggestions or comments on this or any other aspects of the application I am trying to create? (All input will be helpful, that is why I am calling it brain storming)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top