1%%[/* CREATE THE HTML CONTENT BLOCK VIA AMPSCRIPT*/]%%
2%%[Set @asset = CreateObject("Asset")]%%
3
4%%[/* Set AssetType (complex property) */]%%
5%%[SET @nameIdReference = CreateObject("NameIdReference")]%%
6%%[SetObjectProperty(@nameIdReference, "Id", 197); /* html block type */ ]%%
7%%[SetObjectProperty(@asset, "AssetType", @nameIdReference)]%%
8
9%%[/* Set Category (complex property) - aka Folder */]%%
10%%[SET @categoryNameIdReference = CreateObject("CategoryNameIdReference")]%%
11%%[SetObjectProperty(@categoryNameIdReference, "Id", 564334) /* Use the Id value of the desired category (folder) */]%%
12%%[SetObjectProperty(@asset, "Category", @categoryNameIdReference)]%%
13
14%%[/* Set Name, Content, and ContentType (simple text properties) */]%%
15%%[SetObjectProperty(@asset,"Name","AMPSCRIPT HTML Content Block")]%%
16%%[SetObjectProperty(@asset,"Content","<div>my new content</div>")]%%
17%%[SetObjectProperty(@asset,"ContentType","text/html")]%%
18
19%%[Set @StatCode = InvokeCreate(@asset, @StatMessage, @ErrorCode)]%%