Converting Word BookMarks to PDF Files 
Author Message
 Converting Word BookMarks to PDF Files

(I hate cross posting, but it does pertain to PDFs and Word)

I have a Word97 macro that scans a file and breaks it into bookmarks.  I
then need to loop thru the bookmarks and create individual PDFs.

I'm having trouble with the code to automate the creation of the individual
PDFs.
I'm using a combination of the SendKeys to the active printer as such:

Sub SendToPDF(ByVal OutPutFile As String)
Dim PDFFile As String
Dim DateSfx As String
'
' SendToPDf Macro
' Macro recorded 06/11/01 by Nicholas C. Osdale-Popa
'
    DateSfx = Format(DateStamp, "mm-dd-yy")
    PDFFile = OutPutFile & "-" & DateSfx & ".PDF"
    If FileExists(SAVEDIR, PDFFile) Then
        Kill SAVEDIR & "\" & PDFFile
        DoEvents
    End If
    ActivePrinter = "Acrobat PDFWriter"
    SendKeys SAVEDIR & "\" & PDFFile & "{ENTER}"
    Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
        wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
        Collate:=True, Background:=True, PrintToFile:=False
End Sub

The main problem with this is that Acrobat starts to run after the first
file is made.
I would like to use the Acrobat Object (if one exists) to make the files,
rather than using the clumsy SendKeys.

I'm using Word97 and Acrobat 5.0

Thanks.



Sat, 29 Nov 2003 04:56:44 GMT  
 Converting Word BookMarks to PDF Files
If I understand your post correctly you need to take a look at the PDFWriter
API. There you can set ini/registry flags that a) supress the Save As
dialog; and b) allow you to set the output filename. Download a worked
example from:

http://www.brookhouse.co.uk/adobe/tips/docs2pdf.txt

- Roy


Quote:
> (I hate cross posting, but it does pertain to PDFs and Word)

> I have a Word97 macro that scans a file and breaks it into bookmarks.  I
> then need to loop thru the bookmarks and create individual PDFs.

> I'm having trouble with the code to automate the creation of the
individual
> PDFs.
> I'm using a combination of the SendKeys to the active printer as such:

> Sub SendToPDF(ByVal OutPutFile As String)
> Dim PDFFile As String
> Dim DateSfx As String
> '
> ' SendToPDf Macro
> ' Macro recorded 06/11/01 by Nicholas C. Osdale-Popa
> '
>     DateSfx = Format(DateStamp, "mm-dd-yy")
>     PDFFile = OutPutFile & "-" & DateSfx & ".PDF"
>     If FileExists(SAVEDIR, PDFFile) Then
>         Kill SAVEDIR & "\" & PDFFile
>         DoEvents
>     End If
>     ActivePrinter = "Acrobat PDFWriter"
>     SendKeys SAVEDIR & "\" & PDFFile & "{ENTER}"
>     Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
>         wdPrintDocumentContent, Copies:=1, Pages:="",
> PageType:=wdPrintAllPages, _
>         Collate:=True, Background:=True, PrintToFile:=False
> End Sub

> The main problem with this is that Acrobat starts to run after the first
> file is made.
> I would like to use the Acrobat Object (if one exists) to make the files,
> rather than using the clumsy SendKeys.

> I'm using Word97 and Acrobat 5.0

> Thanks.



Sat, 29 Nov 2003 05:30:22 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Converting Word RTF Files with Bookmarks to PDF Forms

2. Converting Word Revision Marks to PDF Annotations Using PDF Marks

3. Converting word file to pdf format

4. Issue With converting a Word File to PDF

5. SAving a MS Word file to a PDF file and a text file

6. Opening pdf file at bookmark from visual basic

7. Positioning .PDF file at specified bookmark?

8. Converting TEXT file to PDF file

9. HOw to convert text FILE IN TO PDF FILE through VB CODE USING adobe type library

10. Converting Word doc. to PDF

11. Converting Word Documents to PDF using Acrobat Distiller

12. Converting Word to PDF?

 

 
Powered by phpBB® Forum Software