SAving a MS Word file to a PDF file and a text file 
Author Message
 SAving a MS Word file to a PDF file and a text file

Hi all,

I try to save a MS Word document to a PDF file (I already have Acrobat 4)
and a text-only file but the SaveAs() method only saves the opened document
in Word format.

Does anyone know how to do that?

Thanks in advance for any reply!

Richard Yu



Sun, 09 Mar 2003 03:00:00 GMT  
 SAving a MS Word file to a PDF file and a text file
IIRC, you can't "Save as" PDF, you have to either use the PDFWriter that
should get loaded as a toolbar in Word, or print to the Acrobat Distiller
printer which will write out a newly created PDF.

As far as the text-only, there should be about 2 or 3 different options
for saving as "Text Only" or "Text Only with Line Breaks", etc.

-Chad


Quote:
> Hi all,

> I try to save a MS Word document to a PDF file (I already have Acrobat 4)
> and a text-only file but the SaveAs() method only saves the opened document
> in Word format.

> Does anyone know how to do that?

> Thanks in advance for any reply!

> Richard Yu



Sun, 09 Mar 2003 03:00:00 GMT  
 SAving a MS Word file to a PDF file and a text file


Fri, 19 Jun 1992 00:00:00 GMT  
 SAving a MS Word file to a PDF file and a text file
Hi Chad,

Thanks for your response.

My first message was just too brief and as a result I guide you to the wrong
path.
I know how to manually create a PDF under word and save it as a text file.

What I was working on is I want to use VBScript to automate the above 2
process.  As a result, rather than just use the SaveAs() method of the
document object, I need to find ways to change the file format to text-only
and then save the word file to a text file.  After that, I also need to use
vbscript to call Acrobat to create a PDF file from the original word doc.

Richard


Quote:
> IIRC, you can't "Save as" PDF, you have to either use the PDFWriter that
> should get loaded as a toolbar in Word, or print to the Acrobat Distiller
> printer which will write out a newly created PDF.

> As far as the text-only, there should be about 2 or 3 different options
> for saving as "Text Only" or "Text Only with Line Breaks", etc.

> -Chad



> > Hi all,

> > I try to save a MS Word document to a PDF file (I already have Acrobat
4)
> > and a text-only file but the SaveAs() method only saves the opened
document
> > in Word format.

> > Does anyone know how to do that?

> > Thanks in advance for any reply!

> > Richard Yu



Sun, 09 Mar 2003 03:00:00 GMT  
 SAving a MS Word file to a PDF file and a text file
I can help you with the second one:

    Dim wrd As New Word.Application
    Dim doc As Word.Document
    wrd.Visible = False
    wrd.ScreenUpdating = False
    wrd.ActivePrinter = "Acrobat Distiller"
    'Open the document
    Set doc = wrd.Documents.Open("worddoc.doc")
    'Print it to a postscript file using Distiller
    doc.PrintOut False, False, , "c:\test.ps", , , , , , , True
    doc.Close False
    wrd.Quit False
    Set doc = Nothing
    Set wrd = Nothing
    'Now call distiller to convert the postscript file to PDF
    Dim acr As New ACRODISTXLib.PdfDistiller
    acr.bShowWindow = False
    acr.FileToPDF "c:\test.ps", "pdfdoc.pdf", ""
    Set acr = Nothing
    'Delete the old PS file
    Kill "c:\test.ps"
    'Done

Cheers


Quote:
> Hi Chad,

> Thanks for your response.

> My first message was just too brief and as a result I guide you to the
wrong
> path.
> I know how to manually create a PDF under word and save it as a text file.

> What I was working on is I want to use vbscript to automate the above 2
> process.  As a result, rather than just use the SaveAs() method of the
> document object, I need to find ways to change the file format to
text-only
> and then save the word file to a text file.  After that, I also need to
use
> vbscript to call Acrobat to create a PDF file from the original word doc.

> Richard



> > IIRC, you can't "Save as" PDF, you have to either use the PDFWriter that
> > should get loaded as a toolbar in Word, or print to the Acrobat
Distiller
> > printer which will write out a newly created PDF.

> > As far as the text-only, there should be about 2 or 3 different options
> > for saving as "Text Only" or "Text Only with Line Breaks", etc.

> > -Chad



> > > Hi all,

> > > I try to save a MS Word document to a PDF file (I already have Acrobat
> 4)
> > > and a text-only file but the SaveAs() method only saves the opened
> document
> > > in Word format.

> > > Does anyone know how to do that?

> > > Thanks in advance for any reply!

> > > Richard Yu



Mon, 10 Mar 2003 03:00:00 GMT  
 SAving a MS Word file to a PDF file and a text file
Phil,

Thanks a lot for your help.  I'll try that.

Richard



Quote:
> I can help you with the second one:

>     Dim wrd As New Word.Application
>     Dim doc As Word.Document
>     wrd.Visible = False
>     wrd.ScreenUpdating = False
>     wrd.ActivePrinter = "Acrobat Distiller"
>     'Open the document
>     Set doc = wrd.Documents.Open("worddoc.doc")
>     'Print it to a PostScript file using Distiller
>     doc.PrintOut False, False, , "c:\test.ps", , , , , , , True
>     doc.Close False
>     wrd.Quit False
>     Set doc = Nothing
>     Set wrd = Nothing
>     'Now call distiller to convert the postscript file to PDF
>     Dim acr As New ACRODISTXLib.PdfDistiller
>     acr.bShowWindow = False
>     acr.FileToPDF "c:\test.ps", "pdfdoc.pdf", ""
>     Set acr = Nothing
>     'Delete the old PS file
>     Kill "c:\test.ps"
>     'Done

> Cheers



> > Hi Chad,

> > Thanks for your response.

> > My first message was just too brief and as a result I guide you to the
> wrong
> > path.
> > I know how to manually create a PDF under word and save it as a text
file.

> > What I was working on is I want to use vbscript to automate the above 2
> > process.  As a result, rather than just use the SaveAs() method of the
> > document object, I need to find ways to change the file format to
> text-only
> > and then save the word file to a text file.  After that, I also need to
> use
> > vbscript to call Acrobat to create a PDF file from the original word
doc.

> > Richard



> > > IIRC, you can't "Save as" PDF, you have to either use the PDFWriter
that
> > > should get loaded as a toolbar in Word, or print to the Acrobat
> Distiller
> > > printer which will write out a newly created PDF.

> > > As far as the text-only, there should be about 2 or 3 different
options
> > > for saving as "Text Only" or "Text Only with Line Breaks", etc.

> > > -Chad



> > > > Hi all,

> > > > I try to save a MS Word document to a PDF file (I already have
Acrobat
> > 4)
> > > > and a text-only file but the SaveAs() method only saves the opened
> > document
> > > > in Word format.

> > > > Does anyone know how to do that?

> > > > Thanks in advance for any reply!

> > > > Richard Yu



Mon, 10 Mar 2003 03:00:00 GMT  
 SAving a MS Word file to a PDF file and a text file

Hi Phil,

In the line:        doc.PrintOut False, False, , "c:\test.ps", , , , , , ,
True

Do you have any idea what are those False and empty switches controlling?  I
want to create a PDF file with bookmarks and page and if I follow your
instructions, the PDF file created will not come with any bookmarks.  I am
wondering whether I can use more switches in the above line to control the
output PDF file.

Once again, thanks a lot for your help!

Richard Yu

Quote:


> > I can help you with the second one:

> >     Dim wrd As New Word.Application
> >     Dim doc As Word.Document
> >     wrd.Visible = False
> >     wrd.ScreenUpdating = False
> >     wrd.ActivePrinter = "Acrobat Distiller"
> >     'Open the document
> >     Set doc = wrd.Documents.Open("worddoc.doc")
> >     'Print it to a PostScript file using Distiller
> >     doc.PrintOut False, False, , "c:\test.ps", , , , , , , True
> >     doc.Close False
> >     wrd.Quit False
> >     Set doc = Nothing
> >     Set wrd = Nothing
> >     'Now call distiller to convert the postscript file to PDF
> >     Dim acr As New ACRODISTXLib.PdfDistiller
> >     acr.bShowWindow = False
> >     acr.FileToPDF "c:\test.ps", "pdfdoc.pdf", ""
> >     Set acr = Nothing
> >     'Delete the old PS file
> >     Kill "c:\test.ps"
> >     'Done

> > Cheers



Sun, 16 Mar 2003 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. How to change or save a MS Word file (*.doc) to a *.html file in VBScript

2. BuiltInDocumentProperties from non-Word text files + testing if a DOC file is a Word file

3. opening / saving files with MS rich text box control (viewing open files)

4. Save all inbox messages to a text file (or text files) with VBA

5. Converting TEXT file to PDF file

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

7. Ghostscript 7.03 and MS Word PDF File size

8. MS Word 7.0 to Postscript or PDF files ...

9. File Loading/Saving File Forms and the MS Flex Grid

10. Saving Access report as an MS Word file

11. How do you save OLE embedded file objects from MS-Word VBA

12. replacing text in a html-file and saving the changed file

 

 
Powered by phpBB® Forum Software