MS WORD ReadOnly Method

Project:Word Documents Created from OE
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi,
My application creates an invoice in MSWORD and then subsequently email's the document. I want to make the document 'Read Only' before the it gets sent off. Does anybody know the syntax to achieve this?

Thanks in advance.

Errol


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

#1

Why you don´t create a PDF?


#2

DOS SILENT attrib +R filename.

Or make it pdf!

Regards,
V.


#3

Well, PDF takes about +- 13 seconds to create and WORD take about 2 seconds. The response time might be an issue for the client.


#4

Well. It just occurred to me the "ReadOnly" will not help because the file can still be changed and then be saves under a different name.


#5

setting the Word document to Read-Only is a step in the right direction. But all /ABL-created/ Word and Excel documents allow the user to resave as a different filename. If you want more control - you will have to consider saving to PDF as a step in the right direction.

check out pdfinclude on here if you want to pursue that option. http://www.oehive.org/pdfinclude

however if you want to keep using .doc + .docx formatting you will need to figure out how to make the doc read-only and add password protection to disallow saves. I've never seen an example of this - and a google search for program examples of this came up empty. even searched c# + vbs examples with no luck.


#6

While I agree the PDF route is the best, it should still be noted that even that solution isn't foolproof for someone changing the document. There are tools that can allow you to recover the underlying Word document. Best solution... PDF with a password.


#7

Yes. It looks like I have to go the PDF route. Already up and running but it is so darn slow!


#8

Hi Errol.

Are you using the MSWORD.olb ? Did you open it in Progress COM Object viewer and could find nothing related to the Word's menu "Protect Document -> Restrict Formatting and Editing"?

I've used this (COM Obj viewer) to make an Excel spreadsheet so I can't help you with Word, but maybe it will give you some new idea for the course of action.

Regards,
V.


#13

If it were me I would not use the ms word format as it locks you into having ms word on the other end to open it.
It is best to save in rich text format. The .rtf can be opened by most or all word processors and your target client is not expected to use
word on their end.

Consider wrapping the document as password protected .zip file. You can execute at the command line winzip commands and issue a password to open it.
.zip files can be opened as well by a number of different programs.
Another option is to convert the ms word doc to .jpg file which is an image rather the real doc, preventing any editing. You can also
wrap that document in a password protected zip file as well a put a watermark on it.

This is how we did it when I worked at area 51.

You can use a random number generator native to progress or 3rd party as your password. Store it in a file and changed it every 24 hours to coincide with the
mail date. Then pre-mail the random password to whoever needs to read the .doc.

Other possibilities is to have the client log into a site using ftp with password protected log in and just dump the doc to their viewing directory.
Very simple to set up. This eliminates the e-mail process in exchange for a pub/sub ftp model.