Automated RTF printing & non-editable print preview

Automated RTF printing & non-editable print preview

Post by Casey Sacket » Sat, 17 Oct 1998 04:00:00



For the RTF files output from my banking application, I need to 1) automate
background printing and 2) provide user print previewing.  WordViewer is the
only RTF viewer (except for Word itself) that supports the full RTF command
set that my application needs, including page breaks, embedded pictures,
tables, etc.  WordViewer is perfect for 2), since it does not allow the user
to edit the RTF file.  However, I have not found a way to achieve 1) with
WordViewer.  Is there a command line switch to make WordViewer print a
document without showing it?  Or can WordViewer be automated through OLE?

Alternatively, I have been trying to achieve the same things by OLE
automating Word.  I can achieve 1) with Word, but am having difficulties
finding a way to achieve 2).  The password protection for modifying a
document is only stored in .doc files, it is not preserved in RTF files.
And I haven't found documentation on how to use OLE to restrict Word to
viewing a document.

Thanks for any ideas, alternatives.

Casey Sackett

 
 
 

Automated RTF printing & non-editable print preview

Post by Matthew Gree » Thu, 22 Oct 1998 04:00:00


I sympathise.  Word 8 or WordViewer is the only thing on the market that can
handle Japanese or right-to-left.  I've tried OLE Automation and it is painful.
I'm generating RTF v1.5 documents and that is painful.  Also, the documentation
in both cases is also rubbish.

The best I can think of is WordViewer 95.  It can be run with the command line
parameters /p and /o, which will cause it to open the document, print and close
automatically.  *THIS DOES NOT WORK IN WORDVIEWER 97*.  I have no idea why.

Unfortunately, it only reads RTF v1.4.  Worse yet, it will display that horrid
splashscreen, even if you start it in state SW_HIDE.  **&^ing Microsoft!  It's
supposed to be a requirement that programs take the starting visible state into
account.

Well, you can always use both WordView and Word.

Matthew Greet


> For the RTF files output from my banking application, I need to 1) automate
> background printing and 2) provide user print previewing.  WordViewer is the
> only RTF viewer (except for Word itself) that supports the full RTF command
> set that my application needs, including page breaks, embedded pictures,
> tables, etc.  WordViewer is perfect for 2), since it does not allow the user
> to edit the RTF file.  However, I have not found a way to achieve 1) with
> WordViewer.  Is there a command line switch to make WordViewer print a
> document without showing it?  Or can WordViewer be automated through OLE?

> Alternatively, I have been trying to achieve the same things by OLE
> automating Word.  I can achieve 1) with Word, but am having difficulties
> finding a way to achieve 2).  The password protection for modifying a
> document is only stored in .doc files, it is not preserved in RTF files.
> And I haven't found documentation on how to use OLE to restrict Word to
> viewing a document.

> Thanks for any ideas, alternatives.

> Casey Sackett



 
 
 

Automated RTF printing & non-editable print preview

Post by Hans Pesat » Wed, 04 Nov 1998 04:00:00


Hi Matthew !

Quote:>> Alternatively, I have been trying to achieve the same things by OLE
>> automating Word.  I can achieve 1) with Word, but am having difficulties
>> finding a way to achieve 2).  The password protection for modifying a
>> document is only stored in .doc files, it is not preserved in RTF files.
>> And I haven't found documentation on how to use OLE to restrict Word to
>> viewing a document.

I also would like to do background printing of WORD-documents or RTF-files.
I am a newbie to COM/DCOM/OLE/ActiveX and I would like to know
how to automate WORD via those interfaces.
Any suggestions ?

Thanx in advance,
Hans Pesata

 
 
 

Automated RTF printing & non-editable print preview

Post by Matthew Gree » Wed, 04 Nov 1998 04:00:00


It looks like you are using VB.  I use Delphi, so there is little I can do to
help you.  But here are a few clues.

1. Word OLE Automation is *slow*!  Even with server-side macros.  Mind you,
since macros don't have parameters, it's sod all use.
2. Word OLE Automation has a lot of bugs.  I intend to publish them on my
website, soon.
3. RTF v1.5 is a nightmare.  Watch for graphics that don't use standard
formats.  Watch for bold formatting around end-row markers.
4. Watch Word OLE Automation mysteriously mangle your controls and you can't
find any good reason.

Matthew Greet


> I also would like to do background printing of WORD-documents or RTF-files.
> I am a newbie to COM/DCOM/OLE/ActiveX and I would like to know
> how to automate WORD via those interfaces.
> Any suggestions ?

> Thanx in advance,
> Hans Pesata

 
 
 

Automated RTF printing & non-editable print preview

Post by carl » Thu, 05 Nov 1998 04:00:00


Quote:>2. Word OLE Automation has a lot of bugs.  I intend to publish them on my
>website, soon.

Amen, brother.

Where is your website?

 
 
 

Automated RTF printing & non-editable print preview

Post by Matthew Gree » Fri, 06 Nov 1998 04:00:00


My website doesn't exist, yet.  I will use the webspace provided by my ISP,
which is 'www.warmachine.u-net.com'.  I would have had it 2 months ago but my
motherboard died and trashed the files.  Give me a few weeks, to re-write it.

Meanwhile, could you tell me about the pain you've had with Word OLE
Automation and RTF?

Matthew Greet


> >2. Word OLE Automation has a lot of bugs.  I intend to publish them on my
> >website, soon.

> Amen, brother.

> Where is your website?

 
 
 

1. Rich Edit Control Printing Problem (like the print preview problem)

Hi,
I've been using the Windows Rich Edit Control to add RTF to some software.
Problem is that when  I print out, what happens is that the text on the
right
can be 'clipped'. I know there is a known problem with print preview with
the RichEdit (problem has been around for a while but 'mysteriously' wasnt
fixed
for windows 98) - and this is like a less dramatic version of the same
problem.
Basically I use the same RichEdit to draw to different areas of the same
page,
by repeatedly loading it with data then FormatRange - ing it to the screen /
printer.

I can't see how its a 'clip rect' thats doing if - what I mean is say I have
a control
containing:
abcdefghijk
abcdefg
abc
.. *every* line (not just the longest one) can be 'unfinished' - bits or
even full
letters can be missing.

Its strange cos sometimes it prints fine, then a subtle change somewhere
can cause the problem to appear just in certain places.
Any suggestions? I've searched the newsgroups for a solution and I couldn't
see it - although the search gave the impression the RichEdit is .. erm ..
not quite as bulletproof and robust as it could be..:)
(I've printed from Windows95 and Windows98 to an HP4000TN, the rich edit is
wrapped using an MFC CRichEditCtrl, compiled using MSVC++ 6)
Thanks in advance,
Brian.

2. thumbs.db.tmp error when publishing web

3. Printing and Print Preview discrepency

4. Partition problem...

5. Printing / Print Preview problems

6. How do I boot to OS 9 so I can hotsunc my palm?

7. Print and Print Preview

8. command line parameters

9. HELP!!!! MFC PRINT/PRINT PREVIEW

10. Print and print preview problem (ASSERT error when allocating GDI font resource in OnBeginPrinting)

11. Print/Print Preview

12. Print and Print preview

13. printing and print preview