Lotus Notes — рабочий инструмент программиста.

Обсуждения программирования на Lotus Notes/Domino

Open database listed in an email ( like GSX errors )

leave a comment »

Sub Initialize
‘ posted to http://www.openntf.org/projects/codebin/codebin.nsf/CodeByDate/BB07663266C769D2862574F60054154B
‘ written by Mike Mortin, 20070830 Dim ws As New NotesUIWorkspace
Dim uiDoc As NotesUIDocument
Dim nServer As NotesName
Dim tempStr As String, fileList As String, server As String
Dim tempVar As Variant
Dim index As Integer
Const kDelim = " " ‘ get email content
Set uiDoc = ws.CurrentDocument
tempStr = uiDoc.FieldGetText("body") ‘ split and join to remove unwanted characters
tempVar = Split(tempStr, Chr(13)) ‘ new line characters
tempVar = Join(tempVar, kDelim)
tempVar = Split(tempVar, "’") ‘ single quotes
tempVar = Join(tempVar, kDelim) ‘ lastly, split into words
tempVar = Split(tempVar, kDelim) ‘ spaces ‘ server name is the next entry
Set nServer = New notesName(tempVar(3))
server = nServer.Common ‘ then parse through remaining entries to get all mailfiles listed
For index = Lbound(tempVar) To Ubound(tempVar)
Print tempVar(index)
If Instr( tempVar(index), ".nsf" ) > 0 Then
‘ add it to the list
tempStr = Left( tempVar(index), Instr( tempVar(index), "nsf") +2 )
fileList = fileList & tempStr & ","
End If
Next index ‘ now, did we find any mail files? If Len(fileList) > 0 Then
‘ make the list and tighen it up
tempVar = Split( fileList, "," )
tempVar = Arrayunique(tempVar)
tempVar = Fulltrim(tempVar) ‘ present and open the db
tempStr = ws.Prompt(4, "Select the database on " & server & " that you want to open.", "Click ‘Cancel’ to exit.", "", Split( fileList, "," ))
If tempStr <> "" Then Call ws.OpenDatabase(server, tempStr)
Msgbox "No mailfiles detected"
End If
End Sub

Original source : http://www.openntf.org/projects/codebin/codebin.ns…


Written by lotusnotes

Январь 28, 2009 в 1:49

Опубликовано в Lotus Notes

Добавить комментарий

Please log in using one of these methods to post your comment:

Логотип WordPress.com

Для комментария используется ваша учётная запись WordPress.com. Выход /  Изменить )

Google+ photo

Для комментария используется ваша учётная запись Google+. Выход /  Изменить )

Фотография Twitter

Для комментария используется ваша учётная запись Twitter. Выход /  Изменить )

Фотография Facebook

Для комментария используется ваша учётная запись Facebook. Выход /  Изменить )


Connecting to %s

%d такие блоггеры, как: