Hi Tony
Isn't ColdFusion is a scripting language like ASP, PHP? If that's the case and your
creating a script then your using VB script rather than VBA. VB script is to VBA, what
VBA is to VB. They're essential language subsets with implementation differences.
I'm also presuming that this is not server side scripting.
Since I know squat about ColdFusion I'll stick to VB Script. Here's how you can use Word
from VB Script:
Here's a simple script that will print a Word document:
Option Explicit
Dim wdApp
Dim docNew
Dim objArgs
Dim strDocument
Dim strOriginalPrinter
' Get the command line arguments
Set objArgs = WScript.arguments
If objArgs.Count = 0 Then
MsgBox "You must supply the name of the file to print"
WScript.Quit (1)
Else
strDocument = objArgs.Item(0)
End If
' Create WOrd application object
Set wdApp = WScript.CreateObject("Word.Application")
With wdApp.Application
' Open the specified document so that we can print it
Set docNew = .Documents.Open(strDocument)
' Save the active printer so tha twe can restore it
strOriginalPrinter = .ActivePrinter
.ActivePrinter = "Print-2-Image"
' Print the document
docNew.PrintOut False, False, 0, "e:\Test.prn", , , 0, 1, "", 0, True, False, "",
False, 0, 0, 0, 0
.ActivePrinter = strOriginalPrinter
docNew.Close 0 ' 0 = wdDoNotSaveChanges
' Finished with Word...
.Quit
End With
Set wdApp = Nothing
HTH + Cheers - Peter
(e-mail address removed) (Tony), said: