Solved

Send Wscript.echo to a text box.

Posted on 2003-10-21
1
1,708 Views
Last Modified: 2013-12-26
Hi all, I have wrote a script which poll's a remote machine for information. Let's use the following example a test case scenario.

On Error Resume Next
strComputer = "Machinexxx"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Product",,48)
For Each objItem in colItems

    Wscript.Echo "Caption: " & objItem.Caption

Next

The problem I am having is that i want to output the result of the Wscript.Echo "Caption: " & objItem.Caption to a text box, so instead i used the following code.

 text1 = objItem.Caption & vbCrLf

Ok great, this now displays the result in the text box. The problem is that the argument may return lots of results, but only the last result is displayed in the text box, hence none of the previous results are displayed.

I have tried setting the text box property to "MultiLine" but still no joy, please help as i'm pulling my hair out.

Cheers,
Ribuck.
0
Comment
Question by:ribuck
1 Comment
 
LVL 44

Accepted Solution

by:
bruintje earned 500 total points
ID: 9590498
try

text1 = text1.Text & objItem.Caption & vbCrLf

hope this helps a bit
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA error replacing data 6 41
Add a task in Outlook from access 11 43
Copy a range from 1..n excel sheets to one destination sheet 2 66
Problem to line 23 74
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question