I have an OLE Word Doc object in a screen. The document data comes from a BLOB in the database [not an actual Word Doc file].
The ole object is configured to open using ole_obj.Activate(Offline!) as opposed to ole_obj.ConnectToNewObject("word.application").
I am trying to achieve WRITE PROTECTED behavior when the BLOB is displayed in the Word Doc that launches on Activate.
I am calling Protect as follows:
ole_obj.object.application.ActiveDocument.Protect(wdAllowOnlyFormFields, FALSE, 'P@ssWord')
and also tried
ole_obj.object.application.ActiveDocument.Protect(0, TRUE, "*****" )
The BLOB data gets displayed in Word, however, the user is allowed to modify the text in the document and click save and close.
NOTE: The changes are NOT saved, which achieves my desired end result, but, the user would have no idea the document is in WRITE PROTECTED mode.
I was hoping that either the user would be prompted when trying to Save indicating read only or maybe presenting the Word Doc grayed out.
It just seems to me that somebody else must have attempted this type of behavior, but I guess we are limited to the PB Ole Word functionality.
Hopefully I have overlooked something.
I am hoping that someone might have examples on how to achieve Word Doc Write Protection that is a bit more obvious to the user.
[PowerBuilder 12.5]
Thanks
The ole object is configured to open using ole_obj.Activate(Offline!) as opposed to ole_obj.ConnectToNewObject("word.application").
I am trying to achieve WRITE PROTECTED behavior when the BLOB is displayed in the Word Doc that launches on Activate.
I am calling Protect as follows:
ole_obj.object.application.ActiveDocument.Protect(wdAllowOnlyFormFields, FALSE, 'P@ssWord')
and also tried
ole_obj.object.application.ActiveDocument.Protect(0, TRUE, "*****" )
The BLOB data gets displayed in Word, however, the user is allowed to modify the text in the document and click save and close.
NOTE: The changes are NOT saved, which achieves my desired end result, but, the user would have no idea the document is in WRITE PROTECTED mode.
I was hoping that either the user would be prompted when trying to Save indicating read only or maybe presenting the Word Doc grayed out.
It just seems to me that somebody else must have attempted this type of behavior, but I guess we are limited to the PB Ole Word functionality.
Hopefully I have overlooked something.
I am hoping that someone might have examples on how to achieve Word Doc Write Protection that is a bit more obvious to the user.
[PowerBuilder 12.5]
Thanks