18.01.2013 Views

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

We create and open a new document using FormID and hgdatabase. The<br />

document handle is returned to hgdocument. If this is unsuccessful, an<br />

error code is returned to hgstatus referring to an invalid database or invalid<br />

<strong>for</strong>m.<br />

hgstatus = HTDocumentCreate(hgdatabase, FormID, hgdocument)<br />

Removing a Document<br />

HTDocumentDelete function: Removes an entire document.<br />

It works this way:<br />

Declare Function HTDocumentDelete Lib “W3HTAPI.DLL” (ByVal<br />

hgdatabase As Long, ByVal hgdocid As Long, ByVal hgdocdelete_flags As<br />

Long) As Long<br />

’hgdatabase Input<br />

HTDocumentDelete ( hgdatabase, hgdocid, hgdocdelete_flags )<br />

Functions Type Descriptions<br />

hgdatabase input The database containing the document<br />

hgdocid input The document id of the document to be deleted<br />

hgdocdelete_flags input Flags affect the operation of this function<br />

HTDOCDELETEF_NO_STUB: Do not save a<br />

deletion stub<br />

HTDOCDELETEF_DELAY_COMMIT: Override<br />

database delay commit property on<br />

HTDOCDELETEF_FORCE_COMMIT: Override<br />

database delay commit property off<br />

If the function fails, an error code is returned to hgstatus. Error codes<br />

include:<br />

HTFAIL_INVALID_DOCUMENT (document does not exist)<br />

HTFAIL_DESIGN_DOCUMENT (non-data document without<br />

docopen_design)<br />

Copying a Document<br />

HTDocumentCopy function: Creates an entire hierarchy copy of the source<br />

document from a view-based index in the destination database.<br />

The function is defined as HTDocumentCopy(hgsrc_database,<br />

src-docid,dest_database, dest_docid)<br />

Chapter 9: Accessing Notes Documents 149

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!