loop through code and refernce text file for info

  • Thread starter Thread starter Sabosis
  • Start date Start date
S

Sabosis

Hello-

I have some scipts in our call management system that export excel
files for each of our representatives, 80 in all. Each time we add or
remove a rep from our team, we need to edit the scripts accordingly.
The code shown below runs for the first rep, then repeats again and
again until all reps have an excel report generated. I want to
simplify this by having a seperate text file that holds the employee
numbers, so that the code will just loop through each rep and pull
their ID # from the text file until all reps have been processed. I
hope this makes sense, any help is greatly appreciated.

There are 4 locations in the code below that I want to pull the number
"72610" from a text file, then repeat the same process for all other
reps.

Scott

'## cvs_cmd_begin
'## ID = 2001
'## Description = "Report: Historical: Designer: CS Agent Summary by
Day adj: Export Data"
'## Parameters.Add "Report: Historical: Designer: CS Agent Summary by
Day adj: Export Data","_Desc"
'## Parameters.Add "Reports","_Catalog"
'## Parameters.Add "2","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Historical\Designer\CS Agent Summary by Day
adj","_Report"
'## Parameters.Add "2","_ACD"
'## Parameters.Add "30","_Top"
'## Parameters.Add "60","_Left"
'## Parameters.Add "15285","_Width"
'## Parameters.Add "11010","_Height"
'## Parameters.Add "The report Historical\Designer\CS Agent Summary
by Day adj was not found on ACD 2.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "72610","Agent" <------ 72610 is the Agent # that I
want pulled from a text list
'## Parameters.Add "-1","Dates"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "M:\CentreVuReports\Agent Daily Reports\Reno Reps
\72610.xls","_Output" <--And here
'## Parameters.Add "9","_FldSep"
'## Parameters.Add "0","_TextDelim"
'## Parameters.Add "True","_NullToZero"
'## Parameters.Add "True","_Labels"
'## Parameters.Add "False","_DurSecs"

On Error Resume Next

cvsSrv.Reports.ACD = 2
Set Info = cvsSrv.Reports.Reports("Historical\Designer\CS Agent
Summary by Day adj")

If Info Is Nothing Then
If cvsSrv.Interactive Then
MsgBox "The report Historical\Designer\CS Agent Summary by Day
adj was not found on ACD 2.", vbCritical Or vbOKOnly, "Avaya CMS
Supervisor"
Else
Set Log = CreateObject("ACSERR.cvsLog")
Log.AutoLogWrite "The report Historical\Designer\CS Agent Summary
by Day adj was not found on ACD 2."
Set Log = Nothing
End If
Else

b = cvsSrv.Reports.CreateReport(Info,Rep)
If b Then

Rep.Window.Top = 30
Rep.Window.Left = 60
Rep.Window.Width = 15285
Rep.Window.Height = 11010



Rep.SetProperty "Agent","72610" <--- And Here

Rep.SetProperty "Dates","-1"




b = Rep.ExportData("M:\CentreVuReports\Agent Daily Reports\Reno
Reps\72610.xls", 9, 0, True, True, False) < ----And here





Rep.Quit



If Not cvsSrv.Interactive Then cvsSrv.ActiveTasks.Remove
Rep.TaskID
Set Rep = Nothing
End If

End If
Set Info = Nothing
 
What you'll get here is a VBA solution. What you need is to post to a
group that supports your script language. I doubt if VBA's syntax to
read/write a text file is compatible with your script language. Look
for a news group that begins with "microsoft.public.scripting."
followed by your scripting language.

Basically, all you need to do is load the text file contents into an
array an loop the array to process for each agent.
 
Back
Top