Tuesday, July 24, 2007


All Lotus Notes developers know that when we open the design's document of view or agent, the properties dialog is opening too. But I dont like this feature, really, I hate it. Actually why in views and agents only? why not in forms too?
To disable this properties dialog you should add variable to notes.ini DesignNoInitialInfobox=1 . try it and you like it :)

Monday, July 16, 2007

Microsoft Excel Worksheet (Embedded Object)

Today I did a simple task, but I never do it before. So, I had a simple form with Microsoft Excel Worksheet (Embedded Object). My task was to extract this embedded object from notes's documents to disk in folder. I had 2 problems:
- how I can choose a folder on my own PC from Lotus Notes client?
- how I can extract object as MS Excek file and save it in chosen folder?

the first task I solved by using undocumented method of NotesUIWorkspace: Let folderTo = w.prompt(14, "", "")

second task I solved by using next code:

If doc.HasEmbedded Then
Forall o In doc.EmbeddedObjects
Set handle = o.Activate(True)
If Not handle Is Nothing Then
Set exWb = handle.Application.ActiveWorkBook

Let VNumber = doc.GetItemValue("VNumber")(0)
Let Agreement_1 = doc.GetItemValue("Agreement_1")(0)
Let fileName = VNumber & SEP & Agreement_1 & ".xls"

On Error Resume Next
Call exWb.SaveAs(folderTo & fileName)
Print {Operate with file '} & folderTo & fileName & {'}
On Error Goto ERR_THIS
End If
End Forall
End If