Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script for OLE automating Jetform

Status
Not open for further replies.

kalle82

Technical User
Apr 2, 2009
163
SE
Hi!

I'm creating an OLE automated VBA script (via word).

What im trying to do is to OLE automate jetform, and insert values from my userform in wrod into jetform forms.

writing an OLE based script was a bit harder than I could imagine.

Im using this code to open a file.

Anyone knows hot to insert values into the fields?

Ive been trying loads of combinations by going through the reference library..

Code:
Sub superjetform()

Dim jetform         As Object
Dim filnamn         As String
Dim oFillerApp      As filler.Application
Dim oJetSubForm     As filler.Subform
Dim oJetForm        As filler.Form
Dim oField          As filler.Field

'arbetsgivareförfrågan

filnamn = "O:\FBF\Förfrågan" & " " & "arbetsgivare.jdt"

Set jetform = CreateObject("Filler.Application")

jetform.Visible = True

filler.Forms.Open (filnamn)


/Carl
 



I Googled and found lots of free stuff regarding this topic.

What library have you referenced for this application?



Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Its the Jetform Filler 5.1 type library.

Ive searched on Google like a thousand times but never found any code example at all.. :(

Thanks for helping me out.

/Carl
 
Okay some progress made:

Problem is that I ahde to change the first line from..
Dim JetApp As application --> Dim JetApp As object

So far so good, but when giving the path to filename it says it cant open it? Very wierd?

Code:
Sub superduperjetform()

'Object declarations
Dim JetApp As Object
Dim oForm As filler.Form
Dim oSubform As filler.Subform
'Launch Filler and set the objects
Set JetApp = CreateObject("Filler.Application")
JetApp.Visible = True
Set oForm = JetApp.Forms.Add("k:\form1.jdt")
Set oSubform = oForm.Records(1).Subforms(1)
'Put values into the fields
oSubform.Fields("JF02").Text = "Diarienummer" ' this is where you would put the variable or field data string
oSubform.Fields("JF03").Text = "till adressen"
oSubform.Fields("JF04").Text = "namn på personen"
'Print and shut down
oForm.PrintOut
JetApp.Quit

End Sub

/Carl
 
Okay solved it!

Here´s the code!

'Launch Filler and set the objects
Set JetApp = New filler.Application
JetApp.Visible = True
Set oForm = JetApp.Forms.Add(filnamn)
'filler.Forms.Open (filnamn)
Set oSubform = oForm.Records(1).Subforms(1)
'Put values into the fields
oSubform.Fields("DIARIENUMMER").Text = TextBox4 ' this is where you would put the variable or field data string
oSubform.Fields("NAMN").Text = namnet$ + mellannamn$ + efternamn$
oSubform.Fields("PNR").Text = personnummer$
oSubform.Fields("ADRESS").Text = streckadress$ + sarskildadress$
'Print and shut down
oForm.PrintOut
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top