Help save net neutrality! Learn more.

set an word customProperty

abx Juno
  • abx Juno

    abx Juno - 2011-09-16

    I just want to add a new property in CustomDocumentProperties with the Add method, but it failed
    with this message :

    IDispatch::Invoke(0x5,1) DISP_E_TYPEMISMATCH 2

    Here's a sample source code :

    IDispatch wd = (IDispatch) wdApp.get("ActiveDocument");
    Object[] arg = new Object[4];
    arg[0] = "Name";
    arg[1] = "toto";
    arg[2] = "LinkedSource";
    arg[3] = new Boolean(false);
    IDispatch props = (IDispatch) wd.get("CustomDocumentProperties");
    props.invoke("Add", arg);

Log in to post a comment.