 |
|
 |
Subject: HyperLink |
 |
 |
 |
Product Area: Domino Server |
 |
Technical Area: Application Development |
 |
Platform: ALL |
 |
Release: 8.5.3 |
 |
Reproducible: Always |
 |
 |
 |
 |
How can i insert a HyperLink on lotus notes mail document using C API.
I used the example from C api samples , but it would insert the whole URL (like https://google.com) as hyperlink in body item.
How can i insert url embedded in some text ?
char FAR *pCDBuffer;
char FAR *pCDBufferStart;
char far *bufPtr;
char szURL[CVMAXPATHLEN];
WORD wItemSize = 0, wBufferSize = MAXONESEGSIZE;
WORD wFormulaLen = 0;
DOMINO_HANDLE hMem;
CDHOTSPOTBEGIN HotSpotBegin;
sprintf(szURL, "%s", recallUrl);
if (sError = OSMemAlloc(0, wBufferSize, &hMem))
{
err.SetError(ERR_MEMORY);
return err;
}
if ((pCDBuffer = (char far *) OSLockObject(hMem)) == NULL)
{
err.SetError(ERR_MEMORY);
return err;
}
memset(pCDBuffer, '\0', wBufferSize);
pCDBufferStart = pCDBuffer;
HotSpotBegin.Type = HOTSPOTREC_TYPE_RCLINK;
HotSpotBegin.Flags = HOTSPOTREC_RUNFLAG_BEGIN | HOTSPOTREC_RUNFLAG_NOBORDER | HOTSPOTREC_RUNFLAG_INOTES;
HotSpotBegin.DataLength = sizeof(szURL);
HotSpotBegin.Header.Signature = SIG_CD_V4HOTSPOTBEGIN;
HotSpotBegin.Header.Length = ODSLength(_CDHOTSPOTBEGIN) + HotSpotBegin.DataLength;
wItemSize += HotSpotBegin.Header.Length;
if (wItemSize % 2)
wItemSize += 1;
bufPtr = pCDBuffer;
ODSWriteMemory((void far * far *)&pCDBuffer, _CDHOTSPOTBEGIN, &HotSpotBegin, 1);
memcpy(pCDBuffer, szURL, sizeof(szURL));
pCDBuffer += sizeof(szURL);
if (((LONG)pCDBuffer) % 2)
pCDBuffer += 1;
sError = PutText(&pCDBuffer, szURL,
(WORD)(wBufferSize - wItemSize), HOTSPOTREC_TYPE_HOTLINK);
if (sError == FALSE)
{
err.SetError(sError);
return err;
}
if (sError = PutV4HotSpotEnd(&pCDBuffer,
(WORD)(wBufferSize - wItemSize),
&wItemSize))
{
err.SetError(ERR(sError));
return err;
}
wItemSize += (WORD)(pCDBuffer - bufPtr);
if (sError = NSFItemAppend(m_hNote,
0,
"Body",
(WORD)strlen("Body"),
TYPE_COMPOSITE,
pCDBufferStart,
(DWORD)(pCDBuffer - pCDBufferStart)))
{
err.SetError(sError);
LogMessage(__FUNCTION__, LOG_NORMAL, __FILE__, __LINE__,
"Error: unable to append item for note [%d]. NSFItemAppend(...) returned: "
"[%d]. Resulting error string: [%s].", m_noteID, err.GetErrorCode(), err.GetMessage().c_str());
OSUnlockObject(hMem);
OSMemFree(hMem);
return err;
}
OSUnlockObject(hMem);
OSMemFree(hMem);
return err;
 
Feedback number WEBBA7QG3W created by ~John Umweetsi on 03/04/2016

Status: Open
Comments:

HyperLink (~John Umweetsi 4.Mar.16)
. . Easiest thng to do is build MIME/HT... (~Sigmund Umwema... 4.Mar.16) |
|  |
|