Use "OpenLogFunctions"
Sub Initialize
On Error GoTo trataerro
Dim sesSessao As New NotesSession
Dim bdCorr As NotesDatabase
Set bdCorr=sesSessao.CurrentDatabase
Dim dc As NotesDocumentCollection
Set dc=bdCorr.UnprocessedDocuments
Dim cont As Integer
cont=dc.Count
If cont=1 Then
Dim docAssis As NotesDocument
Set docAssis=dc.GetFirstDocument
Dim dxExporter As NotesDXLExporter
Dim dxImporter As NotesDXLImporter
Set dxExporter = sesSessao.Createdxlexporter
Set dxImporter = sesSessao.Createdxlimporter
Call dxExporter.setInput(docAssis)
Call dxImporter.setoutput(bdCorr)
dxImporter.Designimportoption = DXLIMPORTOPTION_CREATE
dxImporter.Documentimportoption = DXLIMPORTOPTION_CREATE
Dim t_xslTransformer As NotesXSLTransformer
Set t_xslTransformer = sesSessao.Createxsltransformer()
Dim t_istXSLT As NotesStream
Set t_istXSLT = sesSessao.Createstream()
Dim strStyleXML As String
strStyleXML = {
Call t_istXSLT.Writetext(strStyleXML)
Call t_xslTransformer.Setstylesheet(t_istXSLT)
Call dxExporter.Setoutput(t_xslTransformer)
Call dxImporter.Setinput(t_xslTransformer)
Call dxExporter.Process()
Dim strNoteID As String
strNoteID = dxImporter.Getfirstimportednoteid()
Dim docAssisImp As NotesDocument
Set docAssisImp = bdCorr.Getdocumentbyid(strNoteID)
If docAssisImp Is Nothing Then
MsgBox "O sistema não conseguiu processar a impressão. Por favor, contate um administrador do sistema."
Exit Sub
End If
Call sesSessao.SetEnvironmentVar("ASSISTECEXPORTACAO", "I")
Dim ws As New NotesUIWorkspace
Call ws.DialogBox("fo_cadAssisImp", False, False, True, True, True, True, "Impressão de Assistência Técnica", docAssisImp, False, True, True)
Exit Sub
End If
Msgbox "Você deve selecionar um documento para impressão!"
Exit Sub
trataerro:
Call LogError()
Exit Sub
End Sub
Nenhum comentário:
Postar um comentário