I have a problem regarding VBA for word.
My code returns a form with with several different buttons. I want to click the okay button.
The code im running is modal. Which in this case mean if I dont deal with the form it generates it wont go any further.
The application is being controlled via OLE. I have been through the reference library(jetform filler 5.1 type library) and havent´found any solution to this.
After sum digging I lear that one way to solve this is to start an activex (in another process) that can be started from within the code and it´s only jobb is to look for the generated form and then send command "enter=OK"
Iva managed to creat an OLE automated script, but Active X hmmm... Feels like im digging my own grave.....
My code returns a form with with several different buttons. I want to click the okay button.
The code im running is modal. Which in this case mean if I dont deal with the form it generates it wont go any further.
The application is being controlled via OLE. I have been through the reference library(jetform filler 5.1 type library) and havent´found any solution to this.
After sum digging I lear that one way to solve this is to start an activex (in another process) that can be started from within the code and it´s only jobb is to look for the generated form and then send command "enter=OK"
Iva managed to creat an OLE automated script, but Active X hmmm... Feels like im digging my own grave.....
Code:
Set JetApp = New filler.Application
Dim jetapp2 As filler.Form
JetApp.Visible = True
filnamn = "O:\FBF\Förfrågan Skatten.JTP"
'Launch Filler and set the objects
'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$
filler.ExecuteCommand (jfDownloadFormView)
'Print and shut down
'oForm.PrintForm(1, 19, 1, 1, 1, 1, , , True) = True
'filler.ActiveForm.DetachEventNotify (1)
'JetApp.Quit
Set JetApp = Nothing
Set oForm = Nothing
Set oSubform = Nothing
Set kommando = Nothing