SetDBInputTemplate

説明

データベースからフォーム フィールドを割り当てるための入力ファイル名を設定します。入力ファイルをページごとに開き直す必要がないため、複数ページの作業に役立ちます。

戻り値の型

なし

構文

object.SetDBInputTemplate InputPDFPath

SetDBInputTemplate メソッドは次のパラメータから構成されています。

パラメータ

値の型

説明

Object

 

Toolkit オブジェクト

InputPDFPath

String

テンプレート ファイルへのフルパス

strPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".") & "\"

Set TK = CreateObject("APToolkit.Object")

TK.FormNumbering = 1

r = TK.OpenOutputFile("Output.pdf")

'newly generated PDF

r = TK.SetDBInputTemplate("Input.pdf")

For i = 1 To 5 'copy 5 pages of input to output

SQL = "Select * From Properties"

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPath & _

"ias.mdb;Persist Security Info=False"

TK.SetMasterQuery strConn, "Admin", "", -1, _

"select * from properties where bag=2" 'must find a record

TK.SetDBMultiRowSeparator ""

'provides the delimiter that separates the # in form _

 field names for serparate records

TK.AddRelatedQuery strConn, "Admin", "", -1, SQL, True

'this method allows multiple records to be placed on a page

r = TK.DBToForm(False) 'executes the form filling _

allowing more than one record per page (false)

TK.ResetFormFields 'resets the fields of the form

Next

TK.CloseOutputFile

Set TK = Nothing