Range rng( m_wordDoc.Range(&vtMissing, &vtMissing) );
_Font font;
Shapes shps;
Shape shp;
COleVariant vtRng, vtSafeArrayofPoints;
COleSafeArray safeArrayofPoints;
float fPoints[10][2];
SAFEARRAY safeArray;
SAFEARRAYBOUND aDim[1];  fPoints[0][0] = 10;
fPoints[0][1] = 10;
fPoints[1][0] = 15;
fPoints[1][1] = 15;
fPoints[2][0] = 20;
fPoints[2][1] = 20;
fPoints[3][0] = 25;
fPoints[3][1] = 25;
fPoints[4][0] = 30;
fPoints[4][1] = 30;
fPoints[5][0] = 35;
fPoints[5][1] = 35;
fPoints[6][0] = 40;
fPoints[6][1] = 40;
fPoints[7][0] = 45;
fPoints[7][1] = 45;
fPoints[8][0] = 50;
fPoints[8][1] = 50;
fPoints[9][0] = 55;
fPoints[9][1] = 55; V_VT(&vtRng) = VT_DISPATCH;
V_DISPATCH(&vtRng) = rng;
V_DISPATCH(&vtRng)->AddRef(); DWORD elements[2] = {10, 2};
long indices[2]; safeArrayofPoints.Create(VT_R4, 2, elements); for (int i=0; i<10; i++)
{
indices[0] = i;
for (int j=0; j<2; j++)
{
indices[1] = j;
safeArrayofPoints.PutElement(indices, &fPoints[i][j]);
}
}

shps.AttachDispatch( m_wordDoc.GetShapes() );
shps.AddCurve(safeArrayofPoints, &vtRng);