Wanted: DXL code to export OLE object to Excel and specify “Placement” parameter

倾然丶 夕夏残阳落幕 提交于 2021-01-28 20:44:51

问题


I have working DXL code to export a DOORS module to Excel, including sizing pictures and placing them over the desired cell. (Slightly modified version of GalacticSolutions script ). The default export so far as I can tell applies the parameter "Move but do not size with cell." I'd like to specify "Move and size with cell." This is easy enough to do with an Excel VB macro after the export, but I'd like to avoid that step. I'm hoping there's some Oleput() string that will do this, but can't figure it out.


回答1:


I just worked through this today. In the script, I added a new constant under the Excel VBA Properties section.

const string cExcelPropertyPlacement = "Placement"

Created a new little subroutine:

void excelShapeRangePlacement( OleAutoObj objExcelShapeRange, int OlePlacement ) {
   oleResult( olePut( objExcelShapeRange, cExcelPropertyPlacement, OlePlacement ) )
}

Then called the new routine a the end of the "excelSizeShape" subroutine.

// values: 1-MoveandSize, 2-Move, 3-Freefloating

excelShapeRangePlacement( objExcelShapeRange, 1 )

This should set the value for the OLEs output into Excel..



来源:https://stackoverflow.com/questions/40028654/wanted-dxl-code-to-export-ole-object-to-excel-and-specify-placement-parameter

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!