Converting Word Doc File to PDF Issue…

Here is another issue...
When I make a call to the doc2any.exe to convert a doc file, it leaves an instance of Winword open in memory.
Function Doc2AnyDOCtoPS(strFileIn As String, strFileOut As String)
  Dim shell As Object
  Dim strConvert As String
  Set shell = CreateObject("WScript.Shell")
  strConvert = "C:\Workdir\DocToAny\doc2any_cmd\doc2any.exe" & " " & strFileIn & " " & strFileOut
  shell.Run strConvert, 1, True
End Function
I need to call this function in a loop to convert doc files and the function leaves an instance of Word open for every conversion.
Please advise...

Please add –killoffice parameter to kill office process after conversion, for example,

doc2any.exe -killoffice 1 "C:\in.doc" C:\out.pdf

A couple questions...

What exactly does this option do? When should it be used? 

-useoffice <int> : Use MS Office to render DOC,DOCX,RTF,TXT,PPT,PPTX,PPTS,PPTSX,XLS,XLSX formats

-useoffice 0: Don't use MS Office to convert DOC,DOCX,RTF,TXT,PPT,PPTX,XLS,XLSX formats

-useoffice 1: Use MS Office to convert DOC,DOCX,RTF,TXT,PPT,PPTX,XLS,XLSX formats The conversion from Doc to TIF is very slow. Is there any thing that can be done speed up the conversion?

Basically, I have the call out to doc2any.exe in a loop to convert a folder full of doc files. Each time doc2any.exe is call it loads an instance of Winword.exe to convert the file. It is taking 20-25 secondes to convert each doc.


In general, you can use following command line to convert your DOC file to TIFF file,

Doc2any.exe -useoffice 1 -useprinter -xres 300 -yres 300 -bitcount 1 -compression 4 C:\test.doc C:\out.tif

You can convert one DOC file to TIFF file at one time, please don't run several instances of doc2any.exe at one time, we hoping this method will work better for you.


VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Random Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Verify Code   If you cannot see the CheckCode image,please refresh the page again!