answersLogoWhite

0


Best Answer

Originally, a full version of Adobe's Acrobat application was required to create PDF (Portal Document Format) files from any application, including Microsoft Word. Subsequently, a number of companies sold inexpensive PDF conversion software to compete with the more expensive Adobe product. These applications, like Acrobat, used a printer driver to "print" Postscript-based PDF files. The Mac OS central window server caches window graphics in PDF, allowing any Macintosh application to print to a PDF file from within the OS.

Today, all current versions of Microsoft Word will save directly into PDF format. There's no need to use Visual Basic, assuming you have Microsoft Word.

You can create PDF files programmatically in VB6. You'll need the mjwPDF class and the appropriate PDF fonts. A tutorial on the subject has been attached to this page as a related link: Tutorial - Create PDF files with VB6

Inaddition, you also can use enolsoft PDF Creator to do that. It's fast and simple yet.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

16y ago

Adjust this one to suit specific requirement

http://www.soi12.com/office/story.php?title=Convert_Word_to_PDF_in_bulk

***********************

Sub BatchPrintPDF()

On Error GoTo err_FolderContents

Dim FirstLoop As Boolean

Dim DocList As String

Dim DocDir As String

Dim sPrinter As String

With Dialogs(wdDialogCopyFile)

If .Display 0 Then

DocDir = .Directory

Else

MsgBox "Cancelled by User"

Exit Sub

End If

End With

If Documents.Count > 0 Then

Documents.Close savechanges:=wdPromptToSaveChanges

End If

Application.ScreenUpdating = False

FirstLoop = True

If Left(DocDir, 1) = Chr(34) Then

DocDir = Mid(DocDir, 2, Len(DocDir) - 2)

End If

DocList = Dir$(DocDir & "*.doc")

Do While DocList ""

Documents.Open DocList

With Dialogs(wdDialogFilePrintSetup)

sPrinter = .Printer

.Printer = "Adobe PDF"

.DoNotSetAsSysDefault = True

.Execute

End With

ActiveDocument.PrintOut

ActivePrinter = sPrinter

ActiveDocument.Close savechanges:=wdDoNotSaveChanges

DocList = Dir$()

FirstLoop = False

Loop

Application.ScreenUpdating = True

ActivePrinter = sPrinter

Exit Sub

err_FolderContents:

MsgBox Err.Description

Exit Sub

ActivePrinter = sPrinter

End Sub

****************

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

There are a number of third party assemblies available online that will do the job. You can also take adavantage of the add-in in Word 2007 that saves the DOC file as PDF. All you need to do is to use the word objects to access this functionality through C#.

Refer the related links

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you convert a doc file into a pdf file using C sharp code?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you convert image file to byte code in asp with example code?

How to convert bytecode to .jpeg file in servlet? Thanks


How do you convert .c extension to .exe?

To convert source code (.c file) to an executable (.exe) file you have to use a compiler, which is a translator of source code to machine code.


How do you convert a pdf file into a doc file using VB code?

You will need a PDF server running somewhere that can be accessed by your VB code. It will need to be called from the code through the server and get the PDF file in return. I did that with Tweak PDF Converter, an pdf editor for converting pdf file to word form.


How do you convert an bci file to avi?

Using BadCopy


How do you convert mht file to wmv file?

An MHT file is a web page and a WMV file is a video extension. You can convert an MHT file to a WMV file using Xilisoft Video Converter Ultimate.


How will you recover a file if it is OBJ file and you want to change it to CPP file?

You cannot. Object code files are machine code files that have yet to be linked. There is no way to convert object code back to its original source code.


How do you convert an Ami pro file to a Word file?

You can convert an Ami Pro file to a Word file using software called FileMerlin. FileMerlin is compatible with Windows ME, 98, 2000 and XP.


What is the best free program on the internet that would allow a person to convert a file from wav to mp3?

Convert Files is one of the best online file converts for converting a wav file into an mp3 file. Using the website and giving it your wav file, it will convert it into an mp3 file in a matter of seconds.


How do you Convert exe file to sis formate?

EXE files belong to the Windows OS, while SIS/SISX belong to Nokia's Symbian OS, which is the standard OS for cell phones. it is not possible to convert Windows applications into mobile applications. It is not possible to convert a Windows application into a mobile application, you need to code it from bottom to top using libraries and SDKs created for this purpose.


How can you covert a ZIP file to a JAR file?

We can easily convert the zip file into jar file by using the converting software, named winzip.


How do you use file and folder encryption with a volume using the fat file system and windows?

Convert the volume to NTFS


How do you convert to pdf from any file using ASP?

It is fundamentally impossible to convert "any" file to PDF. PDF is used for text and images. There is no way to translate a program, a movie, or an MP3 file into a PDF.