您的位置:首页 > 其它

lotus script 代理 居家旅行之必备

2009-09-30 15:34 260 查看
‘LS.utilities.BE:

%REM ******************************* Copyright Info *******************************

©2003 Rocky Oliver and Sapphire Oak Technologies, Inc.

This library contains useful functions that are freely available for use under the

terms of an Attribution/NonCommercial/ShareAlike Creative Commons License. This license

can be reviewed at http://creativecommons.org/licenses/by-nc-sa/1.0/
Use of this library constitutes agreement with the aforementioned license. Please leave this

copyright information intact.

There may be exceptions to this licensing, based on contributions by readers of the Lotus Geek

blog (http://www.LotusGeek.com). If there is an exception to this licensing, it will be listed in

the sub or function.

If you would like to contribute a useful function to this library, please send it to Rocky at

rock@LotusGeek.com

Take care of others, be good to yourself. Peace out.

%END REM **************************************************************************

REM This library is used by the following elements:

REM **List the elements that will use this here

%REM ******************************* Functions in this lib *******************************

getDbPath(sourceDB As NotesDatabase, dbpath As String) As Boolean

returns the file path of the provided database, without the file name

it is returned on the dbpath parameter. the function returns True if

successful, False otherwise (and throws error to calling code)

DayOfWeek(d As Integer, abbnum As Integer) As String

provide the number of the day of the week (1 through 7) and the

function returns the name the day (1 = Sunday, 2 = Monday, etc.)

if you provide an abbnum integer greater than 0 it will return an abbreviation

for the day. for instance if the day is 1 and the abbnum is 3, then SUN is

returned.

MonthOfYear(m As Integer, abbnum As Integer) As String

provide the number of the month of the year (1 through 12) and the

function returns the name of the month (1 = January, 2 = February, etc.)

if you provide an abbnum integer greater than 0 it will return an abbreviation

for the month. for instance if the month is 1 and the abbnum is 3, then JAN is

returned.

SortArray(sArray As Variant, orderflag As String) As Boolean

this function sorts the provided array in either ascending or descending order,

based on the order flag: A sorts ascending, D sorts descending.

this function uses four private subs to do the "work" - DoQS_A, DoQS_D,

DoInsertSort_A, and DoInsertSort_D

URLEncode(inString As String) As Boolean

encodes a string for a URL

URLDecode(inString As String) As Boolean

decodes a string from a URL

detachFile(doc As NotesDocument, rtname As String, fname As String, fpath As String) As Boolean

this function detaches the specified attachment to the indicated location

the parameters are as follows:

doc = the document containing the attachment

rtitem = the rich text item containing the attachment

fname = optional. the name of the attachment

fpath = optional. the filepath where the attachment is to be saved

If the fname is an empty string, then the first attachment found in the specified rt item is used

If the fpath is an empty string, then the file is saved to a subdir of the Windows temp dir

initApp(hwd As Variant, appname As String) As Boolean

retuns an application object handle to the provided application name.

the parameters are as follows:

hwd = handle to the object. Passed in as an empty variant, the handle is returned on this param

appname = the programmatic name of the application, e.g. Word.Application for MS Word

getQSValue(qs as String, valname as String, result as String) as Boolean

parses the query string passed in QS and returns the value associated with the name in valname

in the result var. Returns True if it runs correctly, false if it errors out.

sendMailwithURL(Subject As String, BodyMsg As String, recips As Variant, url As String) As Boolean

sends an email with a URL link in it. returns true if successful, false if not.

subject = subject of email

bodymsg = content of msg

recipients = recipients for email (goes in SendTo)

url = the URL to include in the email

getDocURL(doc As NotesDocument, keyitem As String, keyview As String,_

editmode As Boolean, docURL As String, relative As Boolean) As Boolean

creates a URL for a document. includes port numbers (if needed). returns the URL on

the URL parameter.

doc = the doc to link to

keyitem = the name of the item containing the key used for the document in the target view

keyview = the view used in the URL as a target

editmode = if True, uses ?EditDocument; if False, uses ?OpenDocument

docURL = pass in an string var containing and empty string, it returns the constructed URL

relative = if True, returns a relative URL; if False, returns a full URL

ReplaceChars(oldstring As String, oldchars As String, newchars As String) As String

works like @ReplaceSubstring, except this only takes string scalars, not arrays

oldstring = the original source string

oldchars = the character(s) to replace

newchars = the character(s) to replace the oldchars with

SendMailwithDocLink(Subject As String, BodyMsg As String, recips As Variant,_

linkdoc As Variant, linkmsg As String) As Boolean

creates an email with a doclink to a document

subject = subject of email

bodymsg = content of msg

recips = recipients for email (goes in SendTo)

url = the URL to include in the email

linkdoc = the document used as a target for the link

getQSValue(qs As String, valname As String, result As String) As Boolean

get a query_string value from the query_string

qs = the query string

valname = the name of the value you want

result = the related value. pass an empty string var into the function, and the result is returned on it

DBHandle(destdb As String) As NotesDatabase

given a destination database name, returns a handle to the database provided it is in the same

directory as the database where the code is currently executing.

destdb = the filename of the database you want a handle to

****************************** Modification History *******************************

WHO WHEN WHAT

Rock 11/15/02 Initial creation of this library

Rock 11/21/02 Added detachFile function

Rock 04/01/03 Added getQSValue function

Rock 08/07/03 Updated the function descriptions

Rock 01/18/04 Added getServerList function

%END REM
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: