Monday, November 8, 2010

Enable enhanced HTML generation via LotusScript

I have about 850 applications that now needs enhanced HTML generation enabled. As far as I know, the only way to enable this in an application is via LS or manually.

Here's example code for enabling it with LS for one db:
Dim s As New NotesSession, db As NotesDatabase
Set db = s.currentDatabase

'// Fetch the db icon document
Dim col As NotesNoteCollection, doc As NotesDocument
Set col = db.createNoteCollection( False )
col.selectIcon = True
Call col.buildCollection()

'// Enable enhanced HTML
Set doc = db.getDocumentById( col.getFirstNoteId() )
Call doc.replaceItemValue( "$AllowPost8HTML", "1" )
Call doc.save( True, False )
I found the solution here.

3 comments:

Chris C. said...

Thanks! I really appreciate this. I've been trying to figure out how to script this database property change for months, without any luck. I never would have guessed that it was stored in the database icon document.

Unknown said...

No problem :)

I don't think anyone would have guessed it. I suspect the reason they put it there has something to do with backwards compatibility, but who knows..

Jim Fricker said...

Alternate shorter version...

http://www-10.lotus.com/ldd/nd85forum.nsf/DateAllThreadedWeb/d7f7db3804b341c8852578d90080951a?OpenDocument