Why does aaApi_CopyDocumentAttributes always creates a new attribute sheet? Is this by design? If so, is there a way to force it to overwrite the attributes of the target from the source?
Here's a simple snippet of code (very basic, no error handling, only expects one document to to be passed) that demonstrates this. It's called from a document menu added via a MRR.
extern "C" int WINAPI DocCmd_Test ( unsigned int uiCount, //==>Count of documents long* plProjArray, //==>Project number Array long* plDocArray //==> Document number Array ) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); HWND hWndParent = aaApi_GetActiveDocumentList(); LONG lplProjectId = -1L; LONG lplDocumentId = -1L;
// Select the source data aaApi_SelectDocumentDlg2 ( hWndParent, L"Select source file of attributes", NULL, AADOCSELDF_FULLMENU, 0L, &lplProjectId, // o &lplDocumentId // o );
// Copy the source data from source to target aaApi_CopyDocumentAttributes ( lplProjectId, lplDocumentId, plProjArray[0], plDocArray[0], NULL );
aaApi_UpdateDocumentWindows (); return IDOK; }