如何将SAP Document Builder的word控件设置成只读模式

简介: 如何将SAP Document Builder的word控件设置成只读模式

image.pngimage.png

As documented in sap help,it can fulfill my help but unfortunately it is deprecated. Regardless of this warning I have a try and found it does not work indeed.




Then I am speculating that if the document uploaded is read only, it is for sure that the toolbar will be disabled. So the issue turns to that how could I mark the document to be read only on the fly during uploading.


Since word 2007 the format of MS office follows the so called “Open office” protocol whose specification could be found here.

If you change the file type extension from .docx to .zip and open it with WinRAR, you will find the document is actually a bundle of several single files ( called document part in SAP internal ). The editability is controlled within the file settings.xml.

image.png

xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word"

xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main" mc:Ignorable="w14" version="1.0">

 

 

 

 

   

 

 

 

 

   

     

   

   

      readOnly

      1

   

   

 

 

DATA: lr_element   TYPE REF TO if_wd_context_element,

        lv_file_data TYPE xstring,

        lv_ret       TYPE i,

        lx_temp      TYPE xstring,

        lv_msg       TYPE string,

        lt_parms     TYPE /ipro/tt_key_value_pair,

        ls_parm      LIKE LINE OF lt_parms.

  lr_element = me->wd_context->get_element( ).

  CHECK lr_element IS NOT INITIAL.

  lr_element->get_attribute( EXPORTING name = 'BINARY' IMPORTING value = lv_file_data ).

  DATA(lo_docx) = cl_docx_document=>load_document( lv_file_data  ).

  DATA(lo_main_part) = lo_docx->get_maindocumentpart( ).

  DATA(lo_docx_settings) = lo_main_part->get_documentsettingspart( ).

  DATA(lx_settings) = lo_docx_settings->get_data( ).

  /ipro/cl_docx_utilities=>transform( EXPORTING  iv_input_xstring    = lx_settings

                                  iv_transform_name  = '/IPRO/DOCXCC_PROTECT'

                                  it_parameters      = lt_parms

                       IMPORTING  ev_result          = lx_temp

                                  ev_ret             = lv_ret

                                  ev_message         = lv_msg  ).

  lo_docx_settings->feed_data( lx_temp ).

  DATA(lx_docx_package) = lo_docx->get_package_data( ).

  lr_element->set_attribute( EXPORTING name = 'BINARY'  value = lx_docx_package ).

image.pngimage.pngimage.png


目录
相关文章
|
3月前
|
API
在阿里云RPA中,你可以使用"SetForegroundWindow"函数来将SAP控件置顶
【2月更文挑战第28天】 在阿里云RPA中,你可以使用"SetForegroundWindow"函数来将SAP控件置顶
63 1
|
3月前
|
前端开发 搜索推荐 开发者
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
|
3月前
|
JavaScript 前端开发 开发者
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
|
3月前
|
安全 开发者
什么是 SAP ABAP 调试器里的 TRFC Block Sending 设置
什么是 SAP ABAP 调试器里的 TRFC Block Sending 设置
|
3月前
|
XML 存储 数据格式
SAP UI5 控件 customData 属性的应用介绍
SAP UI5 控件 customData 属性的应用介绍
|
3月前
|
开发框架 容器
SAP UI5 控件的 aggregation 的概念解析
SAP UI5 控件的 aggregation 的概念解析
|
3月前
|
前端开发 容器
如何给 SAP UI5 应用设置背景图片试读版
如何给 SAP UI5 应用设置背景图片试读版
|
3月前
|
前端开发 容器
179. 如何给 SAP UI5 应用设置背景图片
179. 如何给 SAP UI5 应用设置背景图片
SAP UI5 Link 控件的使用方法介绍 - 后续学习 Fiori Elements Smart Link 的基础试读版
SAP UI5 Link 控件的使用方法介绍 - 后续学习 Fiori Elements Smart Link 的基础试读版
|
3月前
|
前端开发
问题解答:SAP UI5 应用设置禁止被其他应用嵌入运行的工作原理解析试读版
问题解答:SAP UI5 应用设置禁止被其他应用嵌入运行的工作原理解析试读版

热门文章

最新文章