crear PDF con Acrobat

17/10/2003 - 15:26 por Gandalf | Informe spam
Hola, tengo el Acrobat 6.0 y me gustaría poder pasar un informe a PDF en una
ubicación y con un nombre determinado sin que al usuario se le abra ninguna
ventana ni se le pida ninguna información.

Luego lo mandare por e-mail, pero eso creo que ya lo se hacer.

Un Saludo y Gracias.

Preguntas similare

Leer las respuestas

#1 Jesus
17/10/2003 - 15:58 | Informe spam
He contestado a esto mas abajo.
Busca en internet pdf995


"Gandalf" escribió en el mensaje
news:
Hola, tengo el Acrobat 6.0 y me gustaría poder pasar un informe a PDF en


una
ubicación y con un nombre determinado sin que al usuario se le abra


ninguna
ventana ni se le pida ninguna información.

Luego lo mandare por e-mail, pero eso creo que ya lo se hacer.

Un Saludo y Gracias.


Respuesta Responder a este mensaje
#2 Gandalf
18/10/2003 - 14:11 | Informe spam
Gracias Jesús, pero no es eso lo que pregunto.

Ya se crear archivos PDF y tengo el Acrobat original.

Lo que quiero es saber como se automatiza en proceso, sin intervención del
usuario para poder mandar un informe de Access en pdf por correo
electrónico.

He visto en la Web de Adobe, que tienen ejemplos de como hacerlo en VB pero
hay que pagar por ellos :((((((. Me parece un abuso por parte de Adobe, creo
que es suficiente con pagar la copia de Acrobat.

Un Saludo y Gracias.
"Jesus" escribió en el mensaje
news:
He contestado a esto mas abajo.
Busca en internet pdf995


"Gandalf" escribió en el mensaje
news:
> Hola, tengo el Acrobat 6.0 y me gustaría poder pasar un informe a PDF en
una
> ubicación y con un nombre determinado sin que al usuario se le abra
ninguna
> ventana ni se le pida ninguna información.
>
> Luego lo mandare por e-mail, pero eso creo que ya lo se hacer.
>
> Un Saludo y Gracias.
>
>


Respuesta Responder a este mensaje
#3 Jesus
18/10/2003 - 14:59 | Informe spam
No acabo de ver si lo que quieres es automatizar la creacion del pdf o el
envio por correo.
Si es esto ultimo tienes un ejemplo en el almacen de mi página en la carpeta
Modulos.
Miralo a ver si es y si no miramos mas cosas.


"Gandalf" escribió en el mensaje
news:
Gracias Jesús, pero no es eso lo que pregunto.

Ya se crear archivos PDF y tengo el Acrobat original.

Lo que quiero es saber como se automatiza en proceso, sin intervención del
usuario para poder mandar un informe de Access en pdf por correo
electrónico.

He visto en la Web de Adobe, que tienen ejemplos de como hacerlo en VB


pero
hay que pagar por ellos :((((((. Me parece un abuso por parte de Adobe,


creo
que es suficiente con pagar la copia de Acrobat.

Un Saludo y Gracias.
"Jesus" escribió en el mensaje
news:
> He contestado a esto mas abajo.
> Busca en internet pdf995
>
>
> "Gandalf" escribió en el mensaje
> news:
> > Hola, tengo el Acrobat 6.0 y me gustaría poder pasar un informe a PDF


en
> una
> > ubicación y con un nombre determinado sin que al usuario se le abra
> ninguna
> > ventana ni se le pida ninguna información.
> >
> > Luego lo mandare por e-mail, pero eso creo que ya lo se hacer.
> >
> > Un Saludo y Gracias.
> >
> >
>
>


Respuesta Responder a este mensaje
#4 José Mª Fueyo
18/10/2003 - 15:34 | Informe spam
Hola Gandalf
Obtenido de www.planet-source-code.com
<pego>
'**************************************
'Windows API/Global Declarations for :Cr
' eate PDF from MS Access Report
'**************************************

Declare Function RegEnumValue Lib "advapi32.dll" Alias "RegEnumValueA"
(ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpValueName As String,
lpcbValueName As Long, ByVal lpReserved As Long, lpType As Long, ByVal
lpData As String, lpcbData As Long) As Long


Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA"
(ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long,
ByVal samDesired As Long, phkResult As Long) As Long


Declare Function RegSetValueEx Lib "advapi32" Alias "RegSetValueExA"
(ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As
Long, ByVal dwType As Long, ByVal szData As String, ByVal cbData As
Long) As Long


Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long



Declare Function RegCreateKeyEx Lib "advapi32" Alias "RegCreateKeyExA"
(ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long,
ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As
Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, phkResult As Long,
lpdwDisposition As Long) As Long


#If Win32 Then
Public Const HKEY_CLASSES_ROOT = &H80000000
Public Const HKEY_CURRENT_USER = &H80000001
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const HKEY_USERS = &H80000003
Public Const KEY_ALL_ACCESS = &H3F
Public Const REG_OPTION_NON_VOLATILE = 0&
Public Const REG_CREATED_NEW_KEY = &H1
Public Const REG_OPENED_EXISTING_KEY = &H2
Public Const ERROR_SUCCESS = 0&
Public Const REG_SZ = (1)
#End If


Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Boolean
End Type

code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!


Terms of Agreement:
By using this code, you agree to the following terms...
1) You may use this code in your own programs (and may compile it into a
program and distribute it in compiled format for languages that allow
it) freely and with no charge.
2) You MAY NOT redistribute this code (for example to a web site)
without written permission from the original author. Failure to do so is
a violation of copyright laws.
3) You may link to this code from another website, but ONLY if it is not
wrapped in a frame.
4) You will abide by any additional copyright restrictions which the
author may have placed in the code or code's description.

'**************************************
' Name: Create PDF from MS Access Report
'
' Description:On a machine where the Ado
' be PDFWriter is installed, the current p
' rinter is swapped out with the PDFWriter
' and the PDF file is created. The origina
' l printer is then restored.
' By: Todd Benson
'
' Inputs:rptName = Microsoft Access repo
' rt name you want to create pdf from. sPD
' FPath = the directory path where you wan
' t to create the pdf file (ex. - "c:\data
' \"). sPDFName = the name of the pdf file
' you are wanting to create (ex. - "file00
' 1.pdf").
'
' Assumes:This code is easily modified t
' o be used in other programs
'
' Side Effects:Please use the most recen
' t installs of Adobe Exchange or PDFWrite
' r to ensure proper functionality.
'
'This code is copyrighted and has' limited warranties.Please see
http://w
' ww.Planet-Source-Code.com/vb/scripts/Sho
' wCode.asp?txtCodeId5321&lngWId=1'for
details.'**************************************



Public Function bGetRegValue(ByVal hKey As Long, ByVal sKey As String,
ByVal sSubKey As String) As String
Dim lResult As Long
Dim phkResult As Long
Dim dWReserved As Long
Dim szBuffer As String
Dim lBuffSize As Long
Dim szBuffer2 As String
Dim lBuffSize2 As Long
Dim lIndex As Long
Dim lType As Long
Dim sCompKey As String
Dim bFound As Boolean
lIndex = 0
lResult = RegOpenKeyEx(hKey, sKey, 0, 1, phkResult)


Do While lResult = ERROR_SUCCESS And Not (bFound)
szBuffer = Space(255)
lBuffSize = Len(szBuffer)
szBuffer2 = Space(255)
lBuffSize2 = Len(szBuffer2)
lResult = RegEnumValue(phkResult, lIndex, szBuffer, lBuffSize,
dWReserved, lType, szBuffer2, lBuffSize2)


If (lResult = ERROR_SUCCESS) Then
sCompKey = Left(szBuffer, lBuffSize)


If (sCompKey = sSubKey) Then
bGetRegValue = Left(szBuffer2, lBuffSize2 - 1)
RegCloseKey phkResult
Exit Function
End If
End If
lIndex = lIndex + 1
Loop
RegCloseKey phkResult
End Function


Public Function bSetRegValue(ByVal hKey As Long, ByVal lpszSubKey As
String, ByVal sSetValue As String, ByVal sValue As String) As Boolean
On Error Resume Next
Dim phkResult As Long
Dim lResult As Long
Dim SA As SECURITY_ATTRIBUTES
Dim lCreate As Long
RegCreateKeyEx hKey, lpszSubKey, 0, "", REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, SA, phkResult, lCreate
lResult = RegSetValueEx(phkResult, sSetValue, 0, REG_SZ, sValue,
CLng(Len(sValue) + 1))
RegCloseKey phkResult
bSetRegValue = (lResult = ERROR_SUCCESS)
End Function


Public Function RunReportAsPDF(rptName As String, sPDFPath As String,
sPDFName As String)
'
'rptName = Microsoft Access report name
' you
'want to create pdf from
'sPDFPath = the directory path where you
' want
'to create the pdf file (ex. - "c:\data\
' ")
'sPDFName = the name of the pdf file you
' are
'wanting to create (ex. - "file001.pdf")
'
'
Dim sMyDefPrinter As String
On Error Goto Err_RunReport
'Save current default printer
sMyDefPrinter = bGetRegValue(HKEY_CURRENT_USER,
"Software\Microsoft\WIndows NT\CurrentVersion\Windows", "Device")
' Set default printer to PDF Writer
bSetRegValue HKEY_CURRENT_USER, "Software\Microsoft\Windows
NT\CurrentVersion\Windows", "Device", "Acrobat PDFWriter"
'Setting value for PDFFileName in the re
' gistry stops file dialog box from appear
' ing
bSetRegValue HKEY_CURRENT_USER, "Software\Adobe\Acrobat PDFWriter",
"PDFFileName", sPDFPath + sPDFName
'Run the report


DoCmd.OpenReport rptName, acViewNormal
Exit_RunReport:
' Restore default printer
bSetRegValue HKEY_CURRENT_USER, "Software\Microsoft\WIndows
NT\CurrentVersion\Windows", "Device", sMyDefPrinter
Exit Function
Err_RunReport:
MsgBox Err.Description
Resume Exit_RunReport
End Function
</pego>
El link a la página donde está es http://tinyurl.com/rejh
Espero te sirva.

Salu2.
José Mª Fueyo
[MS-MVP Access]

¡Urgente! Boletín de seguridad MS03-039
http://www.microsoft.com/spain/tech...9-USER.asp

¡Actualizate!
Respuesta Responder a este mensaje
#5 Gandalf
18/10/2003 - 17:45 | Informe spam
Gracias, es lo que estaba buscando.

:))))))))))))))

¡¡¡¡¡¡¡¡¡¡¡¡Muchas gracias José!!!!!!!!!!
Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaSiguiente Respuesta Tengo una respuesta
Search Busqueda sugerida