Abhi
August 1, 2003, 22:23:59
I want to populate fields in header/footer and main text. I use the following method to switch to header/footer. The method succeeds, but still I get the fields from the main text only. Any ideas?
m_pTxServer->HeaderFooterActivate(txHeader);
short nFieldID = 0;
do
{
nFieldID = m_pTxServer->FieldNext(nFieldID, 0);
if (nFieldID <= 0)
break;
m_pTxServer->PutFieldCurrent(nFieldID);
_bstr_t bsBkmName = m_pTxServer->GetFieldData(nFieldID);
//Compare the field names
if (0 == stricmp((const char*)_bstr_t(bzFieldName), (const char*)bsBkmName))
{
//Update the field text
m_pTxServer->PutFieldText(bzFieldValue);
}
} while (nFieldID != 0);
m_pTxServer->HeaderFooterActivate(txHeader);
short nFieldID = 0;
do
{
nFieldID = m_pTxServer->FieldNext(nFieldID, 0);
if (nFieldID <= 0)
break;
m_pTxServer->PutFieldCurrent(nFieldID);
_bstr_t bsBkmName = m_pTxServer->GetFieldData(nFieldID);
//Compare the field names
if (0 == stricmp((const char*)_bstr_t(bzFieldName), (const char*)bsBkmName))
{
//Update the field text
m_pTxServer->PutFieldText(bzFieldValue);
}
} while (nFieldID != 0);