I was able to find the answer in another forum, which I can not remember now and unfortunately can not give credit to the author.
Follow the form to which I was able to perform the entire procedure in the background.
'- atribui nome do documento e o caminho para download as devidas variaveis
sPDFNome = "name"
sPDFPath = "c:\teste" & contrato & Application.PathSeparator
'seta a variavel e cria o objeto do pdf creator
Set pdfjob = CreateObject("PDFCreator.clsPDFCreator")
'- verifica se o programa esta aberto - caso esteja ele vai mandar uma mensagem para e finalizar a sub
'- caso nao esteja -
With pdfjob
If .cStart("/NOProcessingAtStartup") = False Then
MsgBox "Programa Aberto", vbCritical + vbOKOnly, "prtPDFCreator"
Exit Sub
End If
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = sPDFPath
.cOption("AutosaveFilename") = sPDFNome
.cOption("AutosaveFormat") = 0 '0 = pdf
.cClearCache
End With
'- enviar comando para imprimir
'ie.PrintOut copies:=1, ActivePrinter:="PDFCreator"
ie.ExecWB 6, 2, "", ""
'- verifica se o arquivo derminou de ser impresso
Do Until pdfjob.cCountOfPrintjobs = 1
DoEvents
Loop
pdfjob.cPrinterStop = False
'- verifica se tem algum arquivo na lista de impressao
Do Until pdfjob.cCountOfPrintjobs = 0
DoEvents
Loop
'- fechar a impressa
pdfjob.cClose
'- larga o objeto
Set pdfjob = Nothing