Description
Creates an article calling the wf_articleNew, without displaying any dialog box and returns id of created article, or 0 if there was an error.
Syntax
dim result as integer = ArticleNew(articleName , folderId, folderPath, _ typographyName, regionId, regionPath, _ typesAndFormatStr, _ allowOverwrite, _ errMsg) |
articlename
string with unique article name (unique for the selected folder), e.g. "btNews0411".
folderId
valid folder id, or 0 - if you will specify folderPath instead.
folderPath
valid GN4 folder path e.g. "/system/users/reba", or "" - if you will specify folderid instead.
typographyName
name of GN4 typography on your system, e.g. "Default".
regionId
valid region id, or 0 - if you will specify regionPath instead.
regionPath
valid GN4 region path e.g. "Daily:Print", or "" - if you will specify regionid instead.
typesAndFormatStr
specifies the elements and related text format to assign, and should be formatted as a series of: "[name_of_the_element1|name_of_the_format2][name_of_the_element1|name_of_the_format2]", e.g. "[head|head36][body|bodyNews][photo_caption|caption]"
allowOverwrite
if True, will overwrite existing articles, if False will return an error.
errMsg
Specify "" to get a silent work and to return, by reference, the error message or "". Specify a non-empty ìstring, e.g. "X" to display errors while working.
Example
dim errmsg as string = ""
ArticleNew("btNews0411",0, "/system/users/reba", "Default",0, "Daily:Print", "[head|DE Head 50pt W][body|briefs]", false,errmsg)
The above creates the article with head and body, named as btNews0411 in /system/users/reba folder, in the Default typography, in the Daily:Print region, assigning to the head element the DE Head 50pt W format and to the body element, the briefs format. Will not overwrite an existing article, and will return the error message (if any) in errmsg variable.