i am trying to write a c# Word addin to insert cross references to
figure captions within the document.
whenever i try to use the selection.intsertCrossReference command i
get an error : System.Runtime.InteropServices.COMException
(0x800A1066): Command Failed
the code:
ord.
Document doc = WordApp.ActiveDocument;
oCRItems = doc.GetCrossReferenceItems(ref reftyp);
Array items = ((Array)(oCrossReferenceItems));
object refitem = items.GetValue(1);
object oRefType = Word.WdCaptionLabelID.wdCaptionFigure;
object oRefKind = Word.WdReferenceKind.wdEntireCaption;
WordApp.Selection.InsertCrossReference(ref
oRefType,Word.WdReferenceKind.wdEntireCaption,ref refitem,ref
nullobj,ref nullobj,ref nullobj,ref nullobj);
any suggestions on what i am doing wrong?
thanks
Michael