Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Visual Basic (Classic) FAQ

File Conversions

Converting Your Words to PDF file format... by JasonLiew
Posted: 31 Oct 01

Firstly, you have to set the following references:
dim wordapp as new word.application

Private sub

name4file = "C:\temp\ABCE.doc"

DocChange name4file 'this is passing value into function

end sub

sub DocChange(filename as string)

wordapp.visible = false

with wordapp
    .Documents.open filename

    PDF 'open up another function to create pdf file
    PDFSavG filename 'Save your pdf by opening another func

    .Quit False
end with

set wordapp = nothing

end sub

sub PDF

wordapp.Run macroname:="AddOurMenuItem"   wordapp.Runmacroname:="AdobePDFMaker.AutoExec.DoPrintWithLinks"

end sub

sub PDFSavG(name as string)

filecopy name, "C:\ABCD.doc"

end sub

Thats all for the program. Try it out. If you can't fix it in 20, ask for someone who can. see ya.

Nick in forum: JasonLiew
email: c0ol82@hotmail.com

Back to Visual Basic (Classic) FAQ Index
Back to Visual Basic (Classic) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close