Disable Fieldcode 'Fillin'

  • Thread starter Jim via OfficeKB.com
  • Start date
J

Jim via OfficeKB.com

In a doc the fieldcode 'Fillin' is used.

When using this document in a vb script (in this case printing) a window wil
open and show the contens of the Fillin code.

I like to disable the filin code during printing;

========================================================
FileName="D:\KLANTEN\Stork\TESTENV\vb\jim.doc"
PrinterName = "STORKH08815"

Dim WordObj
' On Error Resume Next
Set WordObj = CreateObject("Word.Application")
' This doenst work :) WordObj.Wdfieldtype.wdfieldfillin = False

WordObj.Documents.Open FileName
WordObj.ActivePrinter = PrinterName
WordObj.PrintOut
WordObj.Quit

===============================

Thnx
 
J

Jean-Guy Marcil

Jim via OfficeKB.com was telling us:
Jim via OfficeKB.com nous racontait que :
In a doc the fieldcode 'Fillin' is used.

When using this document in a vb script (in this case printing) a
window wil open and show the contens of the Fillin code.

I like to disable the filin code during printing;

========================================================
FileName="D:\KLANTEN\Stork\TESTENV\vb\jim.doc"
PrinterName = "STORKH08815"

Dim WordObj
' On Error Resume Next
Set WordObj = CreateObject("Word.Application")
' This doenst work :) WordObj.Wdfieldtype.wdfieldfillin = False

WordObj.Documents.Open FileName
WordObj.ActivePrinter = PrinterName
WordObj.PrintOut
WordObj.Quit

===============================
Try something like this:

Const FileName As String = "D:\KLANTEN\Stork\TESTENV\vb\jim.doc"
Const PrinterName As String = "STORKH08815"
Dim WordObj As Word.Application
Dim UserFieldUpdateStatus As Boolean

Set WordObj = CreateObject("Word.Application")

With WordObj
.Documents.Open FileName
UserFieldUpdateStatus = .Options.UpdateFieldsAtPrint
.ActivePrinter = PrinterName
.PrintOut
.Options.UpdateFieldsAtPrint = UserFieldUpdateStatus
.Quit
End With



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

Similar Threads

Print a PDF File in VBA Code 2
print word document 1
Print Excel file via VB 3
Print Excel / Power Point Files 0
Strange problem 2
Need help with Printing 1
VB 6 and MS-Word question 7
Office 2003 SP2 2

Top