Convert Microsoft Word Document to TIFF file...

M

Michael Edenfield

Hi,

(Not sure which newsgroup is designated for the Office Document Imaging,
sorry for the cross-posting...)

My company writes a document management-type application that lets users
store and view various documents via an extensible user interface.
Primarily, we store faxed or scanned documents as multi-paged M-TIFF
files, either CCITT4 bi-tonal or TIFF-JPEG color images. However, our
system allows users to store any type of file, including (in this case)
Microsoft Word documents.

One of our clients has requested that we provide an enhancement that can
display thumbnails of the individual pages from their stored documents,
and permit them to send selected pages through a LAN fax system or save
a recombined TIFF to disk. To do this, we need to be able to generate
a M-TIFF file from a Microsoft Word document in order to extract single
pages from it.

I have a solution that mostly works but has some quirks that make me
suspect there's a better alternative. Currently we're automating Word
and using Microsoft's Document Imagining Writer to "print" the document
to a TIFF output file like so (in C#, so it's kinda ugly):


Word.Document wordDocument = this.wordApplication.Documents.Open(
ref tempFile, ref missing, ref missing, ref falseParam, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing);

this.wordApplication.ActivePrinter =
"Microsoft Office Document Image Writer";

wordDocument.PrintOut(ref trueParam, ref missing, ref range,
ref tempTiffFile, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing);

Given that the above works, in as far as we get a TIFF file with the
same contents as the Word document, my questions are:

1. Is there an easier way to accomplish this besides hijacking the
Document Image Writer?

2. If I must use the Document Image Writer, is there a way to access the
internal properties of the Writer itself, besides the ones that you can
set on a generic printer? Specifically, I need to be able to:

* Set the default output type to TIFF instead of MDI
* Turn off the automatic preview of the converted image.


I haven't had much luck on the web finding information about the Image
Writer. Most of the MODI documentation involves using it to OCR TIFFs
(which works great), and not much about how to create the TIFFs in the
first place :)

Thanks for any help,

--Mike Edenfield
 
A

Abhishek

Hi!
I have a similar problem. I need to convert it to Jpegs and I am having the
same issue.
I have tried a different approach as well but that fails on windows server
2K3 where as works fine on XP systems. Since I need to deploy my app on the
server I am facing this issue.

I have tried the following code in C# as well as VB6 and VBA. It fails in
all 3 on the win2K3 server.
Dim oPageStart As Word.Range
oPageStart.Sections(1).Range.Bookmarks("\page").Range.Select
Clipboard.Clear
oPageStart.Sections(1).Range.Bookmarks("\page").Range.Copy '(Both The
option s Copy as well as Copy ASPicture)
oPageStart.Sections(1).Range.Bookmarks("\page").Range.CopyAsPicture

SavePicture Clipboard.GetData(), ImgName 'This gives an error Invalid
Property

Is there somthing that I am missing that is required for Win2K3
Does anyone have a better solution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top