Solved

manipulate text

Posted on 2001-06-15
13
201 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 50

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

831 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