?
Solved

Send Wscript.echo to a text box.

Posted on 2003-10-21
1
Medium Priority
?
1,712 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

762 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