Computing.Net > Forums > Programming > VBScript open/print/close .tif file

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

VBScript open/print/close .tif file

Reply to Message Icon

Original Message
Name: sweigel
Date: September 19, 2006 at 08:14:21 Pacific
Subject: VBScript open/print/close .tif file
OS: Windows 200
CPU/Ram: 1 GB
Model/Manufacturer: Dell
Comment:

Hello,

I need to open a .tif file and print it out, then close the file using VBScript. I am new at scripting and I do not have a book and I cannot find this anywhere on the web.

Thanks!



Report Offensive Message For Removal


Response Number 1
Name: dustybob
Date: September 19, 2006 at 13:55:32 Pacific
Reply: (edit)

As far as opening the file you could use the ShellExecute function. The ShellExecute function will have to be declared as follows

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) _
As Long

Then you can call the ShellExecute function in your macro by doing something like this

dim someVariable
someVariable = ShellExecute(0&, vbNullString, Environ("USERPROFILE") + "\My Documents\myTiffFile.tif", vbNullString, vbNullString, vbNormalFocus)


More info on ShellExecute can be found here
http://msdn.microsoft.com/library/d...


Report Offensive Follow Up For Removal

Response Number 2
Name: sweigel
Date: September 21, 2006 at 11:05:34 Pacific
Reply: (edit)

Thanks, I used

set shell = createobject("WScript.shell")

shell.Run ("mspaint /pt "filepath" "printer name")



Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software