Solved

manipulate text

Posted on 2001-06-15
13
184 Views
Last Modified: 2010-05-02
How could i adapt this code to save in a .doc 10 columns long
Open "C:\TEST.ini" For Output As #1
For X = 0 To List1.ListCount - 1
Print #1, Left(List1.List(X), 3) & vbCrLf
Next X
Close #1
0
Comment
Question by:leachim
  • 7
  • 3
  • 2
  • +1
13 Comments
 
LVL 3

Expert Comment

by:nigelrowe
ID: 6194910
Do you mean a word document?
0
 

Author Comment

by:leachim
ID: 6194931
nigelrowe
yes
0
 

Author Comment

by:leachim
ID: 6194939
I need to put about 4000 readings from a listbox into a document 10 columns in width
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 6195008
Hi leachim, Use

1. Working Directly with Objects

Dim Doc as Word.Document
set Doc = CreateObject("Word.Document")
...do the loop...
Doc.PrintOut
Doc.SaveAs filename
Set Doc = Nothing

OR

2. Working Through the Application
Dim WordApp as Word.Application
Dim Doc as Word.Document
Set WordApp = new Word.Application
Set Doc = WordApp.Documents.Add
...do the loop...
Set Doc = Nothing
Set WordApp = Nothing
0
 

Author Comment

by:leachim
ID: 6195021
my apologies i should have said wordpad.doc
0
 
LVL 3

Expert Comment

by:nigelrowe
ID: 6195066
Top to bottom, not left to right?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:leachim
ID: 6195082
left to right
0
 

Author Comment

by:leachim
ID: 6195137
0
 

Author Comment

by:leachim
ID: 6195440
NigelRowe
humble apologies i have not found the answer as claimed above
would be appreciative of your comments
0
 
LVL 3

Expert Comment

by:nigelrowe
ID: 6195835
No problem, I didn't have time to get back to you as I'm at work.

You could also use a ListView control.

The WINAPI Looks ok to me, you just have to output the listbox entries line by line into a file, and I'm sure you know how to do that. If you're satisfied now, you should delete this question.

Bye
0
 
LVL 22

Accepted Solution

by:
rspahitz earned 10 total points
ID: 6196066
Presonally, I'd dump it out as a tab-delimited file and load in as needed.
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6196949
Ohhhh.  I guess that was a really bad answer if it only got a C-grade (:@)

Did you want a procedure to do that?
0
 

Author Comment

by:leachim
ID: 6200358
rspahitz
if you have the time a proceedure would be good
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now