PureBasic
PureBasic
Outlook -- Create Reply Email, Update, and Send
See more Outlook Examples
Creates a reply email in the Drafts folder, updates the reply with information, and then sends the reply.Chilkat PureBasic Downloads
IncludeFile "CkHttpResponse.pb"
IncludeFile "CkHttp.pb"
IncludeFile "CkStringBuilder.pb"
IncludeFile "CkHashtable.pb"
IncludeFile "CkJsonObject.pb"
Procedure ChilkatExample()
success.i = 0
; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
http.i = CkHttp::ckCreate()
If http.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
; Use your previously obtained access token here:
CkHttp::setCkAuthToken(http, "MICROSOFT_GRAPH_ACCESS_TOKEN")
; This example will search /Inbox for a message that will be replied to.
; First we need to get the folder ID for /Inbox.
; Then we'll search for messages based on some criteria, and reply to the 1st matching message.
; To reply, we'll create the reply message in the Drafts folder, update it with content, and the send.
; Get the folder ID for /Inbox from the folder map created by this example
htFolderMap.i = CkHashtable::ckCreate()
If htFolderMap.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
sbMap.i = CkStringBuilder::ckCreate()
If sbMap.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkStringBuilder::ckLoadFile(sbMap,"qa_data/outlook/folderMap.xml","utf-8")
CkHashtable::ckAddFromXmlSb(htFolderMap,sbMap)
; Get the ID for the "/Inbox" folder:
folderId.s = CkHashtable::ckLookupStr(htFolderMap,"/Inbox")
If CkHashtable::ckLastMethodSuccess(htFolderMap) <> 1
Debug "Folder ID not found"
CkHttp::ckDispose(http)
CkHashtable::ckDispose(htFolderMap)
CkStringBuilder::ckDispose(sbMap)
ProcedureReturn
EndIf
success = 1
json.i = CkJsonObject::ckCreate()
If json.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::setCkEmitCompact(json, 0)
; Search for unread emails in this folder from support@chilkatsoft.com
CkHttp::ckSetUrlVar(http,"folder_id",folderId)
CkHttp::ckSetUrlVar(http,"select","id,subject")
CkHttp::ckSetUrlVar(http,"filter","(isRead eq false) and (from/emailAddress/address eq 'support@chilkatsoft.com')")
sbResponse.i = CkStringBuilder::ckCreate()
If sbResponse.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success = CkHttp::ckQuickGetSb(http,"https://graph.microsoft.com/v1.0/me/mailFolders/{$folder_id}/messages?$filter={$filter}&$select={$select}",sbResponse)
If success = 0
Debug CkHttp::ckLastErrorText(http)
CkHttp::ckDispose(http)
CkHashtable::ckDispose(htFolderMap)
CkStringBuilder::ckDispose(sbMap)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbResponse)
ProcedureReturn
EndIf
CkJsonObject::ckLoadSb(json,sbResponse)
; Show the results..
Debug CkJsonObject::ckEmit(json)
If CkJsonObject::ckSizeOfArray(json,"value") = 0
Debug "Empty result set."
CkHttp::ckDispose(http)
CkHashtable::ckDispose(htFolderMap)
CkStringBuilder::ckDispose(sbMap)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbResponse)
ProcedureReturn
EndIf
; Sample results:
; {
; "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('me')/mailFolders('AQMkADAwATM0MDAAMS1iNTcwLWI2NTEtMDACLTAwCgAuAAADsVyfxjDU406Ic4X7ill8xAEA5_vF7TKKdE6bGCRqXyl2PQAAAgEMAAAA')/messages(id,subject)",
; "value": [
; {
; "@odata.etag": "W/\"CQAAABYAAADn68XtMop0TpsYJGpfKXY9AADOpwfq\"",
; "id": "AQMkADAwATM0MDAAMS1iNTcwLWI2NTEtMDACLTAwCgBGAAADsVyfxjDU406Ic4X7ill8xAcA5_vF7TKKdE6bGCRqXyl2PQAAAgEMAAAA5_vF7TKKdE6bGCRqXyl2PQAAAM6Jj1wAAAA=",
; "subject": "This email contains a PDF attachment"
; },
; {
; "@odata.etag": "W/\"CQAAABYAAADn68XtMop0TpsYJGpfKXY9AADOpwfs\"",
; "id": "AQMkADAwATM0MDAAMS1iNTcwLWI2NTEtMDACLTAwCgBGAAADsVyfxjDU406Ic4X7ill8xAcA5_vF7TKKdE6bGCRqXyl2PQAAAgEMAAAA5_vF7TKKdE6bGCRqXyl2PQAAAM6Jj14AAAA=",
; "subject": "This email has the word Amazon in the subject.."
; }
; ]
; }
; We'll create a reply for the 1st message in the result set.
; We'll need the message existing id.
existingMsgId.s = CkJsonObject::ckStringOf(json,"value[0].id")
; To create a reply, send a request such as the following:
; POST https://graph.microsoft.com/v1.0/me/messages/{id}/createReply
; Content-type: application/json
; Content-length: 248
;
; {
; "comment": "comment-value"
; }
jsonRequestBody.i = CkJsonObject::ckCreate()
If jsonRequestBody.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckUpdateString(jsonRequestBody,"comment","This is a comment")
CkHttp::ckSetUrlVar(http,"message_id",existingMsgId)
; Create the reply in the Drafts folder:
resp.i = CkHttpResponse::ckCreate()
If resp.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
success = CkHttp::ckHttpJson(http,"POST","https://graph.microsoft.com/v1.0/me/messages/{$message_id}/createReply",jsonRequestBody,"application/json",resp)
If success = 0
Debug CkHttp::ckLastErrorText(http)
CkHttp::ckDispose(http)
CkHashtable::ckDispose(htFolderMap)
CkStringBuilder::ckDispose(sbMap)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbResponse)
CkJsonObject::ckDispose(jsonRequestBody)
CkHttpResponse::ckDispose(resp)
ProcedureReturn
EndIf
; A 201 response indicates success.
If CkHttpResponse::ckStatusCode(resp) = 201
Debug "Created reply draft."
success = 1
Else
Debug "Response status code = " + Str(CkHttpResponse::ckStatusCode(resp))
Debug "Failed to create reply draft."
success = 0
EndIf
; Show the response in both cases..
jsonResponse.i = CkJsonObject::ckCreate()
If jsonResponse.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::setCkEmitCompact(jsonResponse, 0)
CkJsonObject::ckLoad(jsonResponse,CkHttpResponse::ckBodyStr(resp))
Debug CkJsonObject::ckEmit(jsonResponse)
If success = 0
CkHttp::ckDispose(http)
CkHashtable::ckDispose(htFolderMap)
CkStringBuilder::ckDispose(sbMap)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbResponse)
CkJsonObject::ckDispose(jsonRequestBody)
CkHttpResponse::ckDispose(resp)
CkJsonObject::ckDispose(jsonResponse)
ProcedureReturn
EndIf
; ----------------------------------------------
; Get the message id of the newly created reply.
replyMsgId.s = CkJsonObject::ckStringOf(jsonResponse,"id")
; Update the message with new text in the body..
; Send an HTTP PATCH request that looks something like this:
; Only send the message parts that are changing.
; PATCH https://graph.microsoft.com/v1.0/me/messages/{reply_message_id}
; Content-type: application/json
; Content-length: 248
;
; {
; "subject": "subject-value",
; "body": {
; "contentType": "html",
; "content": "updated HTML goes here"
; },
; "inferenceClassification": "other"
; }
jsonPatch.i = CkJsonObject::ckCreate()
If jsonPatch.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckUpdateString(jsonPatch,"body.contentType","html")
; The reply email that Outlook created will contain the original message under a horizontal rule.
; The body.content should contain this substring: "<body bgcolor=\"#FFFFFF\">\r\n<hr "
; We're going to insert our reply after the body tag, and before the hr tag.
sbHtml.i = CkStringBuilder::ckCreate()
If sbHtml.i = 0
Debug "Failed to create object."
ProcedureReturn
EndIf
CkJsonObject::ckStringOfSb(jsonResponse,"body.content",sbHtml)
; Insert the response HTML in the reply HTML body.
numReplaced.i = CkStringBuilder::ckReplaceBetween(sbHtml,"<body bgcolor=" + Chr(34) + "#FFFFFF" + Chr(34) + ">","<hr ",Chr(13) + Chr(10),"<p>This is my response.</p>")
If numReplaced <> 1
Debug "Something is amiss!"
CkHttp::ckDispose(http)
CkHashtable::ckDispose(htFolderMap)
CkStringBuilder::ckDispose(sbMap)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbResponse)
CkJsonObject::ckDispose(jsonRequestBody)
CkHttpResponse::ckDispose(resp)
CkJsonObject::ckDispose(jsonResponse)
CkJsonObject::ckDispose(jsonPatch)
CkStringBuilder::ckDispose(sbHtml)
ProcedureReturn
EndIf
CkJsonObject::ckUpdateString(jsonPatch,"body.content",CkStringBuilder::ckGetAsString(sbHtml))
; Add additional CC, BCC, or TO recipients like this:
numToRecipients.i = CkJsonObject::ckSizeOfArray(jsonResponse,"toRecipients")
i.i = 0
; Copy existing TO recipients.
While i < numToRecipients
CkJsonObject::setCkI(jsonPatch, i)
CkJsonObject::setCkI(jsonResponse, i)
CkJsonObject::ckUpdateString(jsonPatch,"toRecipients[i].emailAddress.name",CkJsonObject::ckStringOf(jsonResponse,"toRecipients[i].emailAddress.name"))
CkJsonObject::ckUpdateString(jsonPatch,"toRecipients[i].emailAddress.address",CkJsonObject::ckStringOf(jsonResponse,"toRecipients[i].emailAddress.address"))
i = i + 1
Wend
; Add an additional TO recipient.
CkJsonObject::setCkI(jsonPatch, numToRecipients)
CkJsonObject::ckUpdateString(jsonPatch,"toRecipients[i].emailAddress.name","Chilkat")
CkJsonObject::ckUpdateString(jsonPatch,"toRecipients[i].emailAddress.address","admin@chilkat.io")
numCcRecipients.i = CkJsonObject::ckSizeOfArray(jsonResponse,"ccRecipients")
i = 0
; Copy existing CC recipients.
While i < numCcRecipients
CkJsonObject::setCkI(jsonPatch, i)
CkJsonObject::setCkI(jsonResponse, i)
CkJsonObject::ckUpdateString(jsonPatch,"ccRecipients[i].emailAddress.name",CkJsonObject::ckStringOf(jsonResponse,"ccRecipients[i].emailAddress.name"))
CkJsonObject::ckUpdateString(jsonPatch,"ccRecipients[i].emailAddress.address",CkJsonObject::ckStringOf(jsonResponse,"ccRecipients[i].emailAddress.address"))
i = i + 1
Wend
; Add an additional CC recipient.
CkJsonObject::setCkI(jsonPatch, numCcRecipients)
CkJsonObject::ckUpdateString(jsonPatch,"ccRecipients[i].emailAddress.name","Chilkat GMail")
CkJsonObject::ckUpdateString(jsonPatch,"ccRecipients[i].emailAddress.address","chilkat.support@gmail.com")
CkJsonObject::setCkEmitCompact(jsonPatch, 0)
Debug CkJsonObject::ckEmit(jsonPatch)
CkHttp::ckSetUrlVar(http,"message_id",replyMsgId)
success = CkHttp::ckHttpJson(http,"PATCH","https://graph.microsoft.com/v1.0/me/messages/{$message_id}",jsonPatch,"application/json",resp)
If success = 0
Debug CkHttp::ckLastErrorText(http)
CkHttp::ckDispose(http)
CkHashtable::ckDispose(htFolderMap)
CkStringBuilder::ckDispose(sbMap)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbResponse)
CkJsonObject::ckDispose(jsonRequestBody)
CkHttpResponse::ckDispose(resp)
CkJsonObject::ckDispose(jsonResponse)
CkJsonObject::ckDispose(jsonPatch)
CkStringBuilder::ckDispose(sbHtml)
ProcedureReturn
EndIf
; A 200 response indicates success.
If CkHttpResponse::ckStatusCode(resp) = 200
Debug "Patched the reply draft."
success = 1
Else
Debug "Response status code = " + Str(CkHttpResponse::ckStatusCode(resp))
Debug "Failed to patch the reply draft."
success = 0
EndIf
; Show the response in both cases..
CkJsonObject::ckLoad(jsonResponse,CkHttpResponse::ckBodyStr(resp))
Debug CkJsonObject::ckEmit(jsonResponse)
If success = 0
CkHttp::ckDispose(http)
CkHashtable::ckDispose(htFolderMap)
CkStringBuilder::ckDispose(sbMap)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbResponse)
CkJsonObject::ckDispose(jsonRequestBody)
CkHttpResponse::ckDispose(resp)
CkJsonObject::ckDispose(jsonResponse)
CkJsonObject::ckDispose(jsonPatch)
CkStringBuilder::ckDispose(sbHtml)
ProcedureReturn
EndIf
; ---------------------------------------------------------------------
; OK, let's send the reply email...
; To send, POST with an empty request body:
; POST https://graph.microsoft.com/v1.0/me/messages/{id}/send
success = CkHttp::ckHttpStr(http,"POST","https://graph.microsoft.com/v1.0/me/messages/{$message_id}/send","","","",resp)
If success = 0
Debug CkHttp::ckLastErrorText(http)
CkHttp::ckDispose(http)
CkHashtable::ckDispose(htFolderMap)
CkStringBuilder::ckDispose(sbMap)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbResponse)
CkJsonObject::ckDispose(jsonRequestBody)
CkHttpResponse::ckDispose(resp)
CkJsonObject::ckDispose(jsonResponse)
CkJsonObject::ckDispose(jsonPatch)
CkStringBuilder::ckDispose(sbHtml)
ProcedureReturn
EndIf
; A 202 response indicates success.
If CkHttpResponse::ckStatusCode(resp) = 202
Debug "Sent the email reply."
; If the status code was 202, there is no response body.
Else
Debug "Response status code = " + Str(CkHttpResponse::ckStatusCode(resp))
Debug "Failed to send the email reply."
CkJsonObject::ckLoad(jsonResponse,CkHttpResponse::ckBodyStr(resp))
Debug CkJsonObject::ckEmit(jsonResponse)
EndIf
Debug "Finished."
; -----------------------------------------------------------------------
; A sample successful JSON response for the createReply looks like this:
; {
; "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#message",
; "@odata.type": "#microsoft.graph.message",
; "@odata.etag": "W/\"CQAAABYAAADn68XtMop0TpsYJGpfKXY9AADQAwR4\"",
; "id": "AQMkADAwATM0MDAAMS1iNTcwLWI2NTEtMDACLTAwCgBGAAADsVyfxjDU406Ic4X7ill8xAcA5_vF7TKKdE6bGCRqXyl2PQAAAgEPAAAA5_vF7TKKdE6bGCRqXyl2PQAAAM-lQbAAAAA=",
; "createdDateTime": "2017-06-01T14:31:56Z",
; "lastModifiedDateTime": "2017-06-01T14:31:56Z",
; "changeKey": "CQAAABYAAADn68XtMop0TpsYJGpfKXY9AADQAwR4",
; "categories": [
; ],
; "receivedDateTime": "2017-06-01T14:31:56Z",
; "sentDateTime": "2017-06-01T14:31:56Z",
; "hasAttachments": false,
; "internetMessageId": "<SN1PR20MB0461AF40FC899A8462536F04E6F60@SN1PR20MB0461.namprd20.prod.outlook.com>",
; "subject": "RE: This email contains a PDF attachment",
; "bodyPreview": "________________________________\r\nFrom: Chilkat Software <support@chilkatsoft.com>\r\nSent: Tuesday, May 30, 2017 10:58:56 PM\r\nTo: chilkatsoft@outlook.com\r\nSubject: This email contains a PDF attachment\r\n\r\nThis email contains a PDF attachment\r\n--\r\nBest Regar",
; "importance": "normal",
; "parentFolderId": "AQMkADAwATM0MDAAMS1iNTcwLWI2NTEtMDACLTAwCgAuAAADsVyfxjDU406Ic4X7ill8xAEA5_vF7TKKdE6bGCRqXyl2PQAAAgEPAAAA",
; "conversationId": "AQQkADAwATM0MDAAMS1iNTcwLWI2NTEtMDACLTAwCgAQAMMaWY-CWmVOqNKt-NiVhkU=",
; "isDeliveryReceiptRequested": false,
; "isReadReceiptRequested": false,
; "isRead": true,
; "isDraft": true,
; "webLink": "https://outlook.live.com/owa/?ItemID=AQMkADAwATM0MDAAMS1iNTcwLWI2NTEtMDACLTAwCgBGAAADsVyfxjDU406Ic4X7ill8xAcA5%2BvF7TKKdE6bGCRqXyl2PQAAAgEPAAAA5%2BvF7TKKdE6bGCRqXyl2PQAAAM%2FlQbAAAAA%3D&exvsurl=1&viewmodel=ReadMessageItem",
; "inferenceClassification": "focused",
; "body": {
; "contentType": "html",
; "content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n<meta content=\"text/html; charset=utf-8\">\r\n</head>\r\n<body bgcolor=\"#FFFFFF\">\r\n<hr tabindex=\"-1\" style=\"display:inline-block; width:98%\"> ... </html>\r\n"
; },
; "sender": {
; "emailAddress": {
; "name": "Matt Smith",
; "address": "chilkatsoft@outlook.com"
; }
; },
; "from": {
; "emailAddress": {
; "name": "Matt Smith",
; "address": "chilkatsoft@outlook.com"
; }
; },
; "toRecipients": [
; {
; "emailAddress": {
; "name": "Chilkat Software",
; "address": "support@chilkatsoft.com"
; }
; }
; ],
; "ccRecipients": [
; ],
; "bccRecipients": [
; ],
; "replyTo": [
; ]
; }
;
; -----------------------------------------------------------------------
; A sample successful PATCH JSON response looks like this:
; {
; "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('admin%40chilkat.io')/messages/$entity",
; "@odata.etag": "W/\"CQAAABYAAADn68XtMop0TpsYJGpfKXY9AADQAwSA\"",
; "id": "AQMkADAwATM0MDAAMS1iNTcwLWI2NTEtMDACLTAwCgBGAAADsVyfxjDU406Ic4X7ill8xAcA5_vF7TKKdE6bGCRqXyl2PQAAAgEPAAAA5_vF7TKKdE6bGCRqXyl2PQAAAM-lQbMAAAA=",
; "createdDateTime": "2017-06-01T15:18:14Z",
; "lastModifiedDateTime": "2017-06-01T15:18:17Z",
; "changeKey": "CQAAABYAAADn68XtMop0TpsYJGpfKXY9AADQAwSA",
; "categories": [
; ],
; "receivedDateTime": "2017-06-01T15:18:15Z",
; "sentDateTime": "2017-06-01T15:18:15Z",
; "hasAttachments": false,
; "internetMessageId": "<SN1PR20MB046138C4A26051200764FE38E6F60@SN1PR20MB0461.namprd20.prod.outlook.com>",
; "subject": "RE: This email has the word Amazon in the subject..",
; "bodyPreview": "This is my response.\r\n\r\n________________________________\r\nFrom: Chilkat Software <support@chilkatsoft.com>\r\nSent: Tuesday, May 30, 2017 11:40:01 PM\r\nTo: Chilkat Software\r\nSubject: This email has the word Amazon in the subject..\r\n\r\nThis email has the word ",
; "importance": "normal",
; "parentFolderId": "AQMkADAwATM0MDAAMS1iNTcwLWI2NTEtMDACLTAwCgAuAAADsVyfxjDU406Ic4X7ill8xAEA5_vF7TKKdE6bGCRqXyl2PQAAAgEPAAAA",
; "conversationId": "AQQkADAwATM0MDAAMS1iNTcwLWI2NTEtMDACLTAwCgAQAE64PfPP1n1IhU4YasnNN0Q=",
; "isDeliveryReceiptRequested": false,
; "isReadReceiptRequested": false,
; "isRead": true,
; "isDraft": true,
; "webLink": "https://outlook.live.com/owa/?ItemID=AQMkADAwATM0MDAAMS1iNTcwLWI2NTEtMDACLTAwCgBGAAADsVyfxjDU406Ic4X7ill8xAcA5%2BvF7TKKdE6bGCRqXyl2PQAAAgEPAAAA5%2BvF7TKKdE6bGCRqXyl2PQAAAM%2FlQbMAAAA%3D&exvsurl=1&viewmodel=ReadMessageItem",
; "inferenceClassification": "focused",
; "body": {
; "contentType": "html",
; "content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n<meta content=\"text/html; charset=utf-8\">\r\n</head>\r\n<body bgcolor=\"#FFFFFF\">\r\n<p>This is my response.</p>\r\n<hr tabindex=\"-1\" style=\"display:inline-block; width:98%\">\r\n<div id=\"divRplyFwdMsg\" dir=\"ltr\"><font face=\"Calibri, sans-serif\" color=\"#000000\" style=\"font-size:11pt\"><b>From:</b> Chilkat Software <support@chilkatsoft.com><br>\r\n<b>Sent:</b> Tuesday, May 30, 2017 11:40:01 PM<br>\r\n<b>To:</b> Chilkat Software<br>\r\n<b>Subject:</b> This email has the word Amazon in the subject..</font>\r\n<div> </div>\r\n</div>\r\n<div><font face=\"Calibri\">This email has the word Amazon in the subject..</font><br>\r\n<div class=\"moz-signature\">-- <br>\r\nBest Regards,<br>\r\nMatt Smith<br>\r\nChilkat Software, Inc.<br>\r\n<p><a href=\"https://twitter.com/chilkatsoft\">Follow Chilkat on Twitter</a> </p>\r\n</div>\r\n</div>\r\n</body>\r\n</html>\r\n"
; },
; "sender": {
; "emailAddress": {
; "name": "Matt Smith",
; "address": "chilkatsoft@outlook.com"
; }
; },
; "from": {
; "emailAddress": {
; "name": "Matt Smith",
; "address": "chilkatsoft@outlook.com"
; }
; },
; "toRecipients": [
; {
; "emailAddress": {
; "name": "Chilkat Software",
; "address": "support@chilkatsoft.com"
; }
; }
; ],
; "ccRecipients": [
; ],
; "bccRecipients": [
; ],
; "replyTo": [
; ]
; }
CkHttp::ckDispose(http)
CkHashtable::ckDispose(htFolderMap)
CkStringBuilder::ckDispose(sbMap)
CkJsonObject::ckDispose(json)
CkStringBuilder::ckDispose(sbResponse)
CkJsonObject::ckDispose(jsonRequestBody)
CkHttpResponse::ckDispose(resp)
CkJsonObject::ckDispose(jsonResponse)
CkJsonObject::ckDispose(jsonPatch)
CkStringBuilder::ckDispose(sbHtml)
ProcedureReturn
EndProcedure