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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Message tracking

Status
Not open for further replies.

DemBones79

Programmer
Jun 12, 2008
7
US
We have field users who send messages to us through Attachmate, and message center personnel who receive and respond to those messages, also through Attachmate. We've been using a macro bound to the "Enter" key to record messages and replies.

The macro uses GetString to grab information from the screen at specific screen coordinates. It then creates/appends a txt file to output the message and response data. VBScript from our webpage then extracts the data from the file, dumps it into a database, and cleans out the file.

The problem is that there are about 200 messages per day in our database that indicate an associate attempted to reply, but there is no reply text. The macro writes to the file twice in the event of a reply, once when the associate presses the reply key and presses enter and again when the associate finishes their response and presses enter to send it. The VBScript handles the job of combining those messages. Can anyone think of a better way to do this?

We have other macros that send information directly to a database by sending it to an ASP using URL parameters. These never seem to have an issue with lost data. None of those have to pass strings of text, though. I know I can use "%20" to represent a space in the URL, but I don't know enough about these macros to get it to insert a %20 into the middle of an existing string of characters.
 
Instead of using an ASP URL, you could have it open an ASP form in the background. When the user hits enter a second time to send the message, it populates a <textarea> field and submits the form (any other criteria could be additional form fields).

When you submit the ASP form (like to an ASP page to process it to the database, could even be itself), I'd probably use a method="Post" as opposed to a method="Get" so that you don't run into the potential problem of a string being too long for the URL.


This is a very simple example of populating an HTML page, but it should work well as a starting place.
Code:
sURL = "[URL unfurl="true"]http://www.google.com"[/URL]
Set oIE = CreateObject("InternetExplorer.Application")
oIE.navigate(sURL)
oIE.visible = True
While oIE.Busy
  WScript.Sleep(100)
Wend
oIE.Document.f.q.Value = "Search String"
oIE.Document.f.Submit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top