-
Topic
-
We have just recently installed a new fax server into our GW system. What we need to do is force all messages that are addressed to “FAX:<number>” to have a cost centre entered into the body of the message for costing/billing purposes. We have 2 possible ways to perform this.
The first option is to create a form which asks users to enter the fax number, cost centre, subject, body of email and any attachments. I have managed to do this with the exception of allowing files to be attached. It then maps the info entered into these fileds to the appropriate mail fields and then sends it. The problem here is being able to attach files from the file system and from our Document Management System. Is there anyway to do this? Even if we click a next button and it gives them the attach documents dialog. The code I am using to do this is below.
The second option is to have an applet that runs on Send which checks to see if the To: address contains FAX: and then displays a dialog box asking the user to enter a cost centre and then appends this to the body of the email.
Is either of the ideas feasible?
Here is the code for the first option.
‘Wizard dialogs and controls
dim IntroDlg‘Other variables
dim Cmd
dim FSO
dim Msg
dim HRT
dim MsgID
dim FaxCtl
dim SubCtl
dim MatterCtl
Dim objMail
Dim objNewMail
Dim objRecipient
dim BodyCtlCAPTION = “Send Fax”
Const cExit = 999
‘
‘ Main Function
‘
Sub Main(Client, GWEvent)
HRT = Chr(13) & Chr(10)
‘ Create Group wise address book object
set FSO = CreateObject(“Scripting.FileSystemObject”)‘ Dialogs
SetupIntroDlg(Client)
‘ Command button
cDoIntro = 100
cCreateFax = 103
cEndDlg = 109Cmd = cDoIntro
Do While Cmd <> cExit
‘Display Introduction dialog
if Cmd = cDoIntro then
select case IntroDlg.execute
case Btn1 Cmd = cCreateFax
case Btn2 Cmd = cExit
end select
end if‘ Create reminder email
if Cmd = cCreateReminderEmail then
CreateReminder
Cmd = cExit
end if
Loopset FSO = nothing
End Sub
””””””””””””””””””””””””””””””””””””””””
‘ Create reminder email
””””””””””””””””””””””””””””””””””””””””
function CreateReminderdim iMsgObject
Set objMail = GroupWise.Account.MailBox.Messages.Add(“GW.MESSAGE.MAIL”)
MsgBox(FaxCtl.Text)
Set objRecipient = objMail.Recipients.Add(“FAX:” & FaxCtl.Text,,0)
With objMail
‘.Priority = Priority
‘.FromText = “Automated Reminder Email”
.Subject = SubCtl.Text
if BodyCtl.Text <> “” then
.BodyText.PlainText = “++COST ” & MatterCtl.Text & HRT & HRT & BodyCtl.Text
end if
‘.DelayedDeliveryDate = DateCtl.Date & ” ” & TimeCtl.TimeEnd With
Set objNewMail = objMail.Send
Set objRecipient = Nothing
Set objMail = Nothingend function
‘
‘ Introduction dialog
‘
Function SetupIntroDlg(Client)set IntroDlg = Utilities.NewControlBoxDialog
with IntroDlg
.AutoSize = TRUE
.Caption = CAPTION
.Title = “Send Fax”
.Button1Caption = “&OK”
.Button2Caption = “&Cancel”
.WizardImage = WIZARDIMAGE
end withSet FaxCtl = IntroDlg.AddEditControl
with FaxCtl
.Caption = “Fax Number:”
.Hint = “Enter the Fax Number to send to”
.Width = 100
end withset MatterCtl = IntroDlg.AddEditControl
with MatterCtl
.Caption = “Matter number:”
.Width = 100
.Hint = “Enter the Matter number this should be billed to”
end withset SubCtl = IntroDlg.AddEditControl
with SubCtl
.Caption = HRT & “Use this subject for the fax:”
.MaxLength = 100
.Hint = “Enter a subject for the fax”
end withset BodyCtl = IntroDlg.AddmemoControl
with BodyCtl
.Caption = “Enter the Body of the fax here”
.Height = 50
.Scrollbars = 4
.Wordwrap = TRUE
end withEnd Function
- You must be logged in to reply to this topic.