Sub Click(Source As Button)
On Error Goto error_handler
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim col As NotesDocumentCollection
Set col = db.UnprocessedDocuments
Dim docselecionado As NotesDocument
Set docselecionado = col.GetFirstDocument
If docselecionado Is Nothing Then
Msgbox |docselecionado não selecionado|
Exit Sub
End If
Dim stream As NotesStream
Set stream = session.CreateStream
Dim exporter As NotesDXLExporter
Dim FILENAME As String
FILENAME = "c:\dados\dxlDocumento.xml"
If Not stream.Open ( FILENAME ,"UTF-8") Then
Messagebox "Cannot open " & FILENAME,, "Error"
Exit Sub
End If
Call stream.Truncate
Set exporter = session.CreateDXLExporter
Call exporter.SetInput ( docselecionado )
Call exporter.SetOutput ( stream )
Call exporter.Process
Exit Sub
error_handler:
Msgbox |Erro na linha: | & Cstr(Erl) & | Tipo: | & Cstr(Err) & | | & Cstr(Error),16,|Error|
Exit Sub
End Sub
Nenhum comentário:
Postar um comentário