Solved

manipulate text

Posted on 2001-06-15
13
213 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
[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
  • 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
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!

 
LVL 51

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
 

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

Technology Partners: 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

Suggested Solutions

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

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