Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Send Wscript.echo to a text box.

Posted on 2003-10-21
1
Medium Priority
?
1,713 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 44

Accepted Solution

by:
bruintje earned 2000 total points
ID: 9590498
try

text1 = text1.Text & objItem.Caption & vbCrLf

hope this helps a bit
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

610 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