private DEInsertTableParam tParam;' [...]Private void InsertTable()
{
   tParam=DEInsertTableParam.DEInsertTableParam();
   tParam.NumRows = 2;
   tParam.NumCols = 3;
   tParam.TableAttrs = "50%";
   tParam.CellAttrs = "";
   tParam.Caption = "New Table";
   DEdit1.ExecCommand(DECMD_INSERTTABLE, OLECMDEXECOPT_DODEFAULT, tParam);
}

解决方案 »

  1.   

    private DEInsertTableParam tParam;' [...]Private void InsertTable()
    {
       tParam=DEInsertTableParam.DEInsertTableParam();//报错
       tParam.NumRows = 2;
       tParam.NumCols = 3;
       tParam.TableAttrs = "50%";
       tParam.CellAttrs = "";
       tParam.Caption = "New Table";
       DEdit1.ExecCommand(DECMD_INSERTTABLE, OLECMDEXECOPT_DODEFAULT, tParam);//
    }
    报错
    1.“DHTMLEDLib.DEInsertTableParam”并不包含对“DEInsertTableParam”的定义
    2. 参数“3” : 无法从“DHTMLEDLib.DEInsertTableParam”转换为“ref object”
    3. 与“AxDHTMLEDLib.AxDHTMLEdit.ExecCommand(DHTMLEDLib.DHTMLEDITCMDID, DHTMLEDLib.OLECMDEXECOPT, ref object)”最匹配的重载方法具有一些无效参数大家看看微软的原文档,帮帮我吧。
    ----------------
    Inserts a table.SyntaxretVal = object.QueryStatus( DECMD_INSERTTABLE )object.ExecCommand DECMD_INSERTTABLE, OLECMDEXECOPT_DODEFAULT, 
    insertTableParamThe insertTableParam requires an object that must be created and populated before being passed to the command. The object's progID is:DEInsertTableParam.DEInsertTableParamIts classID is:47B0DFC7-B7A3-11D1-ADC5-006008A5848cFor example, in Visual Basic you can create the object and execute the command using code such as the following:' The following appears in the Declarations. Optional, but provides
    ' statement completion for the object.
    Private tParam As DEInsertTableParam' [...]Private Sub InsertTable()
       Set tParam = CreateObject("DEInsertTableParam.DEInsertTableParam")
       tParam.NumRows = 2
       tParam.NumCols = 3
       tParam.TableAttrs = "50%"
       tParam.CellAttrs = ""
       tParam.Caption = "New Table"
       DEdit1.ExecCommand(DECMD_INSERTTABLE, OLECMDEXECOPT_DODEFAULT, tParam)
    End Sub