Solved

manipulate text

Posted on 2001-06-15
13
194 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…
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…

863 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

20 Experts available now in Live!

Get 1:1 Help Now