跳到主要內容

Rich Text 的欄位檢查

這個函數可以被用來確認使用者是否在 Rich Text 欄位加入了什麼。
在一個套表中,若是含有必須填入值的 Rich Text 欄位,這是非常有用的函數。
從你確認生效的例行程式中去呼叫這個函數,來檢驗你的 RTF 是不是空的。



Function IsRTFNull(rtfield As String) As Integer

'This function tests a Rich Text field to see whether or not it
is null. It returns TRUE if 'the field is null, and returns
FALSE if the field is not null. It works even if the rich
'text field contains a file attachment, doclink, or OLE
object but does not contain any 'text.

On Error Goto Errhandle

Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument

Call uidoc.ExpandAllSections
'This is only needed if your field is in a section that may be closed when this executes

Call uidoc.GotoField(rtfield)
Call uidoc.SelectAll

'The next line will generate a 4407 error message if the Rich Text Field is null

Call uidoc.DeselectAll

IsRTFNull = False

Exit Function

Errhandle:
Select Case Err
Case 4407
'the DeselectAll line generated an error message, indicating that the rich text field does not contain anything
If currentfield <> "" Then
Call uidoc.GotoField(currentfield)
End If
IsRTFNull = True
Exit Function
Case Else
'For any other error, force the same error to cause LotusScript to do the error handling
Error Err
End Select
End Function

留言

這個網誌中的熱門文章

XPage 紀錄 – IBM XPage Lab 實作 (四)

本次重點在於,自動搜尋 (type-ahead) 功能,跟目前 Web 上輸入文字,自動帶出關鍵字方便使用者輸入。 1.開啟 profileForm 建立下拉 ( 組合框 ) 欄位的選項值↓ 點選該欄位,選下方『值』 à 先點『新增項目』出現未命名,在輸入選項值↑

安裝 Office 2003 Service Pack 3 後,特定檔案格式會被封鎖的資訊

安裝 Office 2003 Service Pack 3 後,特定檔案格式會被封鎖的資訊 檢視此文章適用的產品。 注意事項 重要 本文包含如何修改登錄的相關資訊。修改登錄之前,請務必將它備份起來,並了解在發生問題時如何還原登錄。如需有關如何備份、還原和修改登錄的詳細資訊,請按一下下面的文件編號,檢視「Microsoft 知識庫」中的文件: 256986 (http://support.microsoft.com/kb/256986/ ) 說明 Microsoft Windows 登錄 在此頁中 結論 簡介 其他相關資訊 Excel PowerPoint PowerPoint Word Corel Draw

Notes改 Internet Password

Internet Password Change application helps users in changing their Internet Password. This application is 'web browser only' application and is IE and Netscape browser complaint. The application gets the new password as input from the user and updates the Internet Password in his person document in the address book. Please note that this application is an enhancement over previous version available at:   http://www.notes.net/sandbox.nsf/ByDateNJ/6b3ac13c82ba68c885256b4f0074c89d?OpenDocument Use this version when "Use more secure Internet Passwords" option is enabled in the Domino Directory Profile. If the option is not enabled then using the previous version is advisable. Using the application: Step 1: Sign the database using an ID which can edit any person document in the names.nsf. Usually this will be the server administrator. Step 2: Open the "Change Password" form from anywhere on your Intranet. Sample Code -