Access - Informe de Access y PDF Creator mandar email.

 
Vista:

Informe de Access y PDF Creator mandar email.

Publicado por JUAN ANTONIO (2 intervenciones) el 18/09/2013 23:39:28
Buen dia.
He conseguido conertir un informe desde Access 2003 Con PDF Creator y le he dado la instruccion de que me lo guarde en una ruta especifica y que el nombre del PDF Sea con los calores de dos campos. pero quiero agragarle a este mismo codigo que me tome el campo email y que me lo adjunte en un correo, Hasta el momento ya lo hace por que en las opciones del PDFCreator tiene la opcopn despues de autoguardar enviar por email. Pero no me sale el email que tengo en ese informe este es mi codigo haber si alguen pudiera echarme la mano y mandarle la intruccion que cuando me abre el correo con el informe adjunto ya convertido en pdf salga tambien la direccion de email en el cuadro PARA

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Dim pdfjob As PDFCreator.clsPDFCreator
    Dim sPDFName As String
    Dim sPDFPath As String
    Dim sPrinterName As String
    Dim sReportName As String
    Dim lPrinters As Long
    Dim lPrinterCurrent As Long
    Dim lPrinterPDF As Long
    Dim prtDefault As Printer
 
    '/// Change the report and output file name here! ///
    Dim nomArchivo As String
    sReportName = "cotizacion"
    sPDFName = "PRESUPUESTO No." & Me.nodecotizacion & "-" & Format(Date, "dd.mm.yy") & ".pdf"
    sPDFPath = "c:\informes\"
 
    'Resolve index number of printers to allow changing and preserving
    sPrinterName = Application.Printer.DeviceName
    On Error Resume Next
    For lPrinters = 0 To Application.Printers.Count
        Set Application.Printer = Application.Printers(lPrinters)
        Set prtDefault = Application.Printer
        Select Case prtDefault.DeviceName
            Case Is = sPrinterName
                lPrinterCurrent = lPrinters
            Case Is = "PDFCreator"
                lPrinterPDF = lPrinters
            Case Else
                'do nothing
        End Select
    Next lPrinters
    On Error GoTo 0
 
    'Change the default printer
    Set Application.Printer = Application.Printers(lPrinterPDF)
    Set prtDefault = Application.Printer
    'Start PFF Creator
    Set pdfjob = New PDFCreator.clsPDFCreator
    With pdfjob
        If .cStart("/NoProcessingAtStartup") = False Then
            MsgBox "Can't initialize PDFCreator.", vbCritical + _
                    vbOKOnly, "PrtPDFCreator"
            Exit Sub
        End If
        .cOption("UseAutosave") = 1
        .cOption("UseAutosaveDirectory") = 1
        .cOption("AutosaveDirectory") = sPDFPath
        .cOption("AutosaveFilename") = sPDFName
        .cOption("AutosaveFormat") = 0    ' 0 = PDF
        .cClearCache
    End With
 
    'Print the document to PDF
    Dim where As String
     where = "[nodecotizacion]=" & Me.nodecotizacion
    DoCmd.OpenReport sReportName, acNormal, , where
 
    'Wait until the print job has entered the print queue
    Do Until pdfjob.cCountOfPrintjobs = 1
        DoEvents
    Loop
    pdfjob.cPrinterStop = False
 
    'Wait until PDF creator is finished then release the objects
    Do Until pdfjob.cCountOfPrintjobs = 0
        DoEvents
    Loop
    pdfjob.cClose
 
    'Reset the (original) default printer and release PDF Creator
    Set Application.Printer = Application.Printers(lPrinterCurrent)
    Set pdfjob = Nothing
End Sub

Por su atencion Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder