Pause printing between copies

M

Mark

I am using WORD 97 onwards, I need to print 4 copies of a document, but need
to update a field in the document on each copy.

Is there a way that this can be done?

If so, would someone be kind enough to provide me with some code.

Thanks in anticipation.
 
J

Jean-Guy Marcil

Mark was telling us:
Mark nous racontait que :
I am using WORD 97 onwards, I need to print 4 copies of a document,
but need to update a field in the document on each copy.

How do you plan on updating the field?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
M

Mark

I was thinking on the lines of:

ActiveDocument.formfields("type").Result = "This is for Peter"

ActiveDocument.formfields("type").Result = "This is for John"

etc....
 
J

Jean-Guy Marcil

Mark was telling us:
Mark nous racontait que :
I was thinking on the lines of:

ActiveDocument.formfields("type").Result = "This is for Peter"

ActiveDocument.formfields("type").Result = "This is for John"

Try this:

'_______________________________________
Option Explicit

'_______________________________________
Sub PrintCopies()

Dim MyBackgroudOptions As Boolean
Dim GetText As String
Dim GetNumber As String
Dim i As Long

MyBackgroudOptions = Options.PrintBackground
Options.PrintBackground = False

Do
GetNumber = InputBox("How many copies do you need.", _
"Print Out Count")
Loop While Not IsNumeric(GetNumber) And Not GetNumber = ""

If GetNumber = "" Then GoTo LeaveSub

For i = 1 To CLng(GetNumber)
GetText = InputBox("Type the text to use for copy number " _
& i & ".", "Print Copies")

If Not GetText = "" Then
Myprintout GetText
End If
Next

LeaveSub:
Options.PrintBackground = MyBackgroudOptions

End Sub
'_______________________________________


'_______________________________________
Function Myprintout(FieldText As String) As Boolean

With ActiveDocument
.FormFields("type").Result = FieldText
.PrintOut
End With

End Function
'_______________________________________

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
M

Mark

Jean-Guy,

Fantastic, thank you

--
Mark


Jean-Guy Marcil said:
Mark was telling us:
Mark nous racontait que :


Try this:

'_______________________________________
Option Explicit

'_______________________________________
Sub PrintCopies()

Dim MyBackgroudOptions As Boolean
Dim GetText As String
Dim GetNumber As String
Dim i As Long

MyBackgroudOptions = Options.PrintBackground
Options.PrintBackground = False

Do
GetNumber = InputBox("How many copies do you need.", _
"Print Out Count")
Loop While Not IsNumeric(GetNumber) And Not GetNumber = ""

If GetNumber = "" Then GoTo LeaveSub

For i = 1 To CLng(GetNumber)
GetText = InputBox("Type the text to use for copy number " _
& i & ".", "Print Copies")

If Not GetText = "" Then
Myprintout GetText
End If
Next

LeaveSub:
Options.PrintBackground = MyBackgroudOptions

End Sub
'_______________________________________


'_______________________________________
Function Myprintout(FieldText As String) As Boolean

With ActiveDocument
.FormFields("type").Result = FieldText
.PrintOut
End With

End Function
'_______________________________________

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top