Solved

manipulate text

Posted on 2001-06-15
13
215 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 52

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

Industry Leaders: 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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

737 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