troubleshooting Question

VBS - need Order Number to be printed on bottom of page

Avatar of TheGreatEye OfSauron
TheGreatEye OfSauronFlag for United States of America asked on
Visual Basic Classic.NET Programming
9 Comments1 Solution402 ViewsLast Modified:
A previous IT guy had programmed this code to print pictures on a Microsoft Word document.

However, because of the volume of these documents.

We need either 1) best case scenario - the Order Number to be printed on the BOTTOM of the page. Or 2) the page number at the Bottom of the page (just to make them easier to sort out).

(I replaced the "servername" with "mycompany").

Thank you,
HappyTech
Option Explicit
On Error Resume Next

Dim objFSO
Dim FS
Dim TextStream
Dim Line
Dim FileName
Dim NewFileName
Dim FolderPath 
Dim objFolder
Dim colFiles
Dim objFile
Dim X
Dim NewName
Dim AppWord
Dim Doc1
Dim ordernum
Dim OrderFile

ordernum = Wscript.Arguments.Item(0)
OrderFile = "\\mycompany\shares\share1\TDR\Orders\" & Ordernum & ".txt"


Set objFSO = CreateObject("Scripting.FileSystemObject")

objFSO.DeleteFile("\\mycompany\shares\share1\TDR\Converted\*.jpg")
objFSO.DeleteFile("\\mycompany\shares\share1\TDR\RAW\*.jpg")

Set FS = objFSO.GetFile("\\mycompany\shares\share1\TDR\Orders\" & Ordernum & ".txt")

set TextStream = FS.OpenAsTextStream()


Do While Not TextStream.AtEndOfStream
		
		Line = TextStream.readline
		Line = Trim(Line)

		Filename = "\\mycompany\shares\share1\TDR\TDR_Images\" & Line & ".jpg"
		NewFileName = "\\mycompany\shares\share1\TDR\RAW\" & Line & ".jpg"

	objFSO.copyfile Filename, NewFileName, True
		
		
	Loop



X=1
FolderPath = "\\mycompany\shares\share1\TDR\Raw"

Set objFolder = objFSO.GetFolder(FolderPath)
Set colFiles = objFolder.Files




For Each objFile In colFiles

NewName = "\\mycompany\shares\share1\TDR\Converted\" & x & ".jpg"
objFile.Copy NewName
x=x+1

Next

objFSO.DeleteFile("\\mycompany\shares\share1\TDR\RAW\*.jpg")

if x<11 then 

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
appword.visible=true

End if 

if x>10 and x<21 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
appword.visible=true

End if

if x>20 and x<31 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")

appword.visible=true

End if

if x>30 and x<41 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
appword.visible=true

End if

if x>40 and x<51 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")

appword.visible=true

End if

if x>50 and x<61 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
appword.visible=true

End if

if x>60 and x<71 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")

appword.visible=true

End if

if x>70 and x<81 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label8.doc")

appword.visible=true

End if

if x>80 and x<91 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label8.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label9.doc")

appword.visible=true

End if

if x>90 and x<101 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label8.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label9.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label10.doc")
appword.visible=true

End if

if x>100 and x<111 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label8.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label9.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label10.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label11.doc")
appword.visible=true

End if

if x>110 and x<121 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label8.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label9.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label10.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label11.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label12.doc")
appword.visible=true

End if


if x>120 and x<131 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label8.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label9.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label10.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label11.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label12.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label13.doc")
appword.visible=true

End if


if x>130 and x<141 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label8.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label9.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label10.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label11.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label12.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label13.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label14.doc")
appword.visible=true

End if


if x>140 and x<151 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label8.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label9.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label10.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label11.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label12.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label13.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label14.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label15.doc")
appword.visible=true

End if


if x>150 and x<161 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label8.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label9.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label10.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label11.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label12.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label13.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label14.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label15.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label16.doc")
appword.visible=true

End if


if x>160 and x<171 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label8.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label9.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label10.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label11.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label12.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label13.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label14.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label15.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label16.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label17.doc")
appword.visible=true

End if

if x>170 and x<181 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label8.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label9.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label10.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label11.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label12.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label13.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label14.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label15.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label16.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label17.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label18.doc")
appword.visible=true

End if

if x>180 and x<191 then

Set AppWord = CreateObject("Word.Application")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label1.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label2.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label3.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label4.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label5.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label6.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label7.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label8.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label9.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label10.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label11.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label12.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label13.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label14.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label15.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label16.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label17.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label18.doc")
AppWord.Documents.open("\\mycompany\shares\share1\TDR\Docs_Xerox\Label19.doc")
appword.visible=true

End if



If x>190 then 

msgbox("You are trying to print " & x & " TDRs" & vbCRLF & "Our current limit is 190.  Please call IT!")

End If
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros