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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print and Close Application

Status
Not open for further replies.

strosfan99

Technical User
Jun 4, 2010
3
US
I am trying to open .plt files and print them with Plotviewer. So far I am able to open these .plt files with plotviewer. My next step is to print and close each file.

any suggestions?

the strOption = " /print" doesn't seem to work.

Sub printplt2()

Dim sSourceDir As String
Dim sNextFile As String

sSourceDir = "C:\pdmsuser\"
sNextFile = Dir$(sSourceDir & "*.plt")
strProg = """C:\AVEVA\PDMS11.6.SP5\plot\PlotViewer.exe"""
strFile = sSourceDir & sNextFile
strOption = " /print"

While sNextFile <> ""
Shell strProg & " " & strFile & strOption
sNextFile = Dir$
Wend

Exit Sub

End Sub
 
It's the program we use to print out our drawing plot files generated from PDMS.
 
I think it is for viewing HPGL files.

However, unless the executable is VBA compliant (and you can get the instruction syntax), I do not think you will be able to print using that exectable within your VBA. You have:
Code:
Shell strProg & " " & strFile & strOption
with strOption apparently being a /print parameter.


Does that work on its own?

Gerry
 
Now I know what some folks feel like when I'm talking tech-related stuff.

I don't what PDMS is, and I don't know what HPGL files are. I can Google them some time later. I imagine it's a separate application.

If I get the time later, I might try to research further, just for my own understanding.

Hope you get it sorted out. Do follow the path fumei is talking about, if you're trying to do it from VBA. Using Shell is likely the only or the best way to get things done outside of Office Apps with VBA...
 
The question is, does:

Shell = """C:\AVEVA\PDMS11.6.SP5\plot\PlotViewer.exe""", filename.plt /print

itself work. In other words, can you Shell out to PlotView.exe with one filename and print it?

If so, then in theory youshould be able to do multiples.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top