Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help me modify this script 2

Status
Not open for further replies.

dpgirl

Technical User
Apr 5, 2005
45
US
I'm clueless about VBScript so I'm hoping someone can help me modify this script. This script was generated by an application I'm using. I'd like to do 2 things:

1) Output the file in text format instead of HTML
2) Change the output file naming convention to reflect the creation date (Login_IDs_YYYYMMDD.txt).

Much thanks in advance!

Code:
'LANGUAGE=ENU
'SERVERNAME=10.130.87.13
Public Sub Main()

'## cvs_cmd_begin
'## ID = 2001
'## Description = "Dictionary: Report: Login Identifications: Save HTML"
'## Parameters.Add "Dictionary: Report: Login Identifications: Save HTML","_Desc"
'## Parameters.Add "Dictionary","_Catalog"
'## Parameters.Add "1","_Action"
'## Parameters.Add "1","_Quit"
'## Parameters.Add "Dictionary\\Login Identifications","_Report"
'## Parameters.Add "1","_ACD"
'## Parameters.Add "-60","_Top"
'## Parameters.Add "-60","_Left"
'## Parameters.Add "19320","_Width"
'## Parameters.Add "15030","_Height"
'## Parameters.Add "The report Dictionary\\Login Identifications was not found on ACD 1.","_ReportNotFound"
'## Parameters.Add "*","_BeginProperties"
'## Parameters.Add "*","_EndProperties"
'## Parameters.Add "*","_BeginViews"
'## Parameters.Add "*","_EndViews"
'## Parameters.Add "H:\Projects\Leads by Product Type\Avaya Dictionary Reports\Login_IDs.txt","_Output"
'## Parameters.Add "","_Template"
'## Parameters.Add "True","_UseFonts"

   On Error Resume Next

   cvsSrv.Dictionary.ACD = 1
   Set Info = cvsSrv.Dictionary.Reports("Dictionary\\Login Identifications")

   If Info Is Nothing Then
	  If cvsSrv.Interactive Then
		  MsgBox "The report Dictionary\\Login Identifications was not found on ACD 1.", vbCritical Or vbOKOnly, "Avaya CMS Supervisor"
	  Else
	   	  Set Log = CreateObject("ACSERR.cvsLog") 
		  Log.AutoLogWrite "The report Dictionary\\Login Identifications was not found on ACD 1."
		  Set Log = Nothing
	  End If
   Else

	   b = cvsSrv.Dictionary.CreateReport(Info,Rep)
	   If b Then
	
	      Rep.Window.Top = -60
	      Rep.Window.Left = -60
	      Rep.Window.Width = 19320
	      Rep.Window.Height = 15030        
	
	      b = Rep.SaveHTML("H:\Projects\Leads by Product Type\Avaya Dictionary Reports\Login_IDs.txt", True, "")
	
	      Rep.Quit

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

   End If
   Set Info = Nothing
'## cvs_cmd_end

End Sub
 
dpgirl,
not sure about the save as part - does your app allow you to save as plain text? did you try removing HTML from b = Rep.SaveHTML...?
as far as your date requirement:
Code:
Dim char_date
char_date = Year(Now) & Right("0" & Month(Now),2) & Right("0" & Day(Now),2)
near the top of the script
adjust
Code:
b = Rep.SaveHTML("H:\Projects\Leads by Product Type\Avaya Dictionary Reports\Login_IDs.txt", True, "")
to read
Code:
b = Rep.SaveHTML("H:\Projects\Leads by Product Type\Avaya Dictionary Reports\Login_IDs_" & char_date & ".txt", True, "")
should do the trick
regards,
longhair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top