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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VBScript open/print/close .tif file

Reply to Message Icon

Name: sweigel
Date: September 19, 2006 at 08:14:21 Pacific
OS: Windows 200
CPU/Ram: 1 GB
Product: 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!




Sponsored Link
Ads by Google

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

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...


0

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

Thanks, I used

set shell = createobject("WScript.shell")

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



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







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


Sponsored links

Ads by Google


Results for: VBScript open/print/close .tif file

C++ opening & closing a file www.computing.net/answers/programming/c-opening-amp-closing-a-file-/9263.html

printing in C www.computing.net/answers/programming/printing-in-c/8814.html

Renameing Tif Files www.computing.net/answers/programming/renameing-tif-files/14927.html