问题
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