Use X++ to control word drawing Chart

来源:互联网 发布:java 国内 大牛博客 编辑:程序博客网 时间:2024/05/16 07:16
 
Use X++ to control word drawing Chart :
 
//reference : HRMOrganizationChartWord
static void drawInWord(Args _args)
{
    #define.Word('Word.Application')
    #define.msoDiagramOrgChart(1)
    #define.msoDiagramNode(1)
    #define.msoDiagramAssistant(2)
 
   COM     comAppl;
    COM     comDocuments;
    COM     comDocument, comShapes, comShape, comDiagramNode, comChildren, comNode;
    COM     comTextShape, comTextFrame, comTextRange;
    ;
    comAppl = new COM(#Word);
    comDocuments = comAppl.documents();
    comDocument     = comDocuments.add();
    comShapes       = comDocument.shapes();
    comShape        = comShapes.addDiagram(#msoDiagramOrgChart,0,0,0,0, COMArgument::NoValue);
    comDiagramNode = comShape.diagramNode();
 
    comChildren     = comDiagramNode.children();
    comNode         = comChildren.addNode(COMArgument::NoValue, #msoDiagramNode);
    comTextShape = comNode.textShape();
    comTextFrame = comTextShape.textFrame();
    comTextRange = comTextFrame.textRange();
    comTextRange.text('HI');
 
    comChildren = comNode.children();
    comNode         = comChildren.addNode(COMArgument::NoValue, #msoDiagramNode);
    comTextShape = comNode.textShape();
    comTextFrame = comTextShape.textFrame();
    comTextRange = comTextFrame.textRange();
    comTextRange.text('Hello');
 
    comAppl.visible(true);
 
}

 The same category existed at here.

 

原创粉丝点击