2008年10月19日 星期日

Notes To Word可以避免『文字字串太長』的作法



MS Word String Too Long
-----------------------------
透過Word的「插入\功能變數」+「插入\書籤」的方法:
如圖(一):
然後在Word上建立『Introduction』這欄位,並且定義書籤「插入\書籤」如圖(二);即可準確的讓Notes文字資料轉至Word上。
-----------------------------
You could try this:

1. Create a text field in Word (using the form toolbar).
2. Double click on it to display a dialog box
3. Specify a Bookmark name under Field Settings
4. If the field on the Notes document is called "Introduction" and the Bookmark in Word is called "Introduction" the following code should work for you irrespective of the length of the string in the field:

'DECLARATIONS
Dim ws as New NotesUIWorkspace
Dim uidoc as NotesUIDocument
Dim doc as NotesDocument
Dim word As Variant
Dim wordoc As Variant
Dim temp as string

'GET A HANDLE ON THE NOTES DOCUMENT TO BE EXPORTED
Set uidoc = ws.CurrentDocument
Set doc = uidoc.Document

'CREATE THE WORD OBJECT
Set word = CreateObject("Word.Application")
Call word.documents.add ( "c:\worddoc.doc" )
Set worddoc = word.activedocument

'WRITE OUT THE FIELD VALUE TO WORD
If doc.Introduction(0) <> "" Then
temp = doc.Introduction(0)
WordDoc.Bookmarks("Introduction").Select
Call Word.Selection.TypeText(temp)

Else
temp = ""
WordDoc.Bookmarks("Introduction").Select
Call Word.Selection.TypeText(temp)
End If


2008年9月3日 星期三

建立如何將Lotus Notes的資料傳送MS Project,而產生甘特圖

=============================================
Create "MSProject Demo" document to see the demo.
=============================================
這個資料庫是透過 "MSProjectLib" 這程式庫模組將進度項目從Lotus Notes的進度項目 匯到MS Project 來產生甘特圖。

這程式庫包含以下三個函數:

1. CreateModule.
2. CreateActivity
3. CloseModule.

模組參數型態:
1. ModuleName String

進度項目參數:
1. ActivityName String
2. StartDate Date/Time
3. EndDate Date/Time
4. IsFirstActivity Integer                  (1 for true 0 for false)
---資料來源 IBM  網站 Lotus Sandbox 

2008年9月1日 星期一

LS遞回函數

%REM
功能:呼叫自己,可應用在數值累加的計算
參數:theNum%
限制:32K的限制
%ENDREM
Function Facto# (theNum%)
' Calculate theNum% factorial and make it
' the return value of Facto#.
If theNum% <= 0 Then
Facto# = 0
ElseIf theNum% = 1 Then
Facto# = 1
Else
Facto# = theNum% * Facto#(theNum% -1)
End If
End Function
----取自Lotus Domino Designer help