Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.conversions,microsoft.public.word.formatting.longdocs,microsoft.public.word.newusers
|
|||
|
|||
![]()
Hello all,
How do I open a text file in MS Word so that it is not bound to a paper size or margins? I have a text file that I need to import into MS Access/SQL Server. This text file runs out to column 174 in Notepad (when Word Wrap is shut off). But this text file is in a "Report" format: every 57 lines is the page header for the next page and then records follow. That is why I want to open it in Word, so I can run macros on it to delete the page headers and the summaries at the end of each section so I can import only records into Access/SQL Server. When ever I open it in Word, first the File Conversion dialog box pops up with Unicode selected. I click "OK", but then the ruler shows up at the top of the Word doc limited to 11.5" and the lines are wrapping when it gets to the right margin. I've tried changing paper size and margins but can't seem to get the 11.5" ruler to expand so the lines will quit wrapping and each record will only take up one line. I'm afraid of how that will affect my macros. They will depend heavily on finding certain text and then deleting a certain number of lines once that text is found. I would definitely be more comfortable writing/running my macros if the lines did not wrap. I'm sorry if I'm ruffling some feathers by multi-/cross- posting on 3 different NG's. I just figure that I'm expanding my audience and have a better chance of getting my questions answered. Thanks for any help anyone can provide, Conan Kelly |
#2
![]()
Posted to microsoft.public.word.conversions,microsoft.public.word.formatting.longdocs,microsoft.public.word.newusers
|
|||
|
|||
![]()
A Word document will always fit the template it's based on (and every
document is based on a template). In the current case, normal.dot is being used. If you're writing macros anyway, it would be simpler to read the file directly into a variable, work on it there, then write it back (ie without ever displaying it at all) -- Dim pLines() as string Dim pFileNum as long pFileNum = freefile Open "C:\My Documents\...." for input as pFileNum pLines = Split(Input(Lof(pFilenum),pFilenum), vbCr) Close #pFileNum ' Do whatever to pLines() Open "C:\My Documents\...." for output as pFileNum Print #pFileNum, Join(pLines, vbCr) Close #pFileNum "Conan Kelly" CTBarbarin at msn dot com wrote in message ... Hello all, How do I open a text file in MS Word so that it is not bound to a paper size or margins? I have a text file that I need to import into MS Access/SQL Server. This text file runs out to column 174 in Notepad (when Word Wrap is shut off). But this text file is in a "Report" format: every 57 lines is the page header for the next page and then records follow. That is why I want to open it in Word, so I can run macros on it to delete the page headers and the summaries at the end of each section so I can import only records into Access/SQL Server. When ever I open it in Word, first the File Conversion dialog box pops up with Unicode selected. I click "OK", but then the ruler shows up at the top of the Word doc limited to 11.5" and the lines are wrapping when it gets to the right margin. I've tried changing paper size and margins but can't seem to get the 11.5" ruler to expand so the lines will quit wrapping and each record will only take up one line. I'm afraid of how that will affect my macros. They will depend heavily on finding certain text and then deleting a certain number of lines once that text is found. I would definitely be more comfortable writing/running my macros if the lines did not wrap. I'm sorry if I'm ruffling some feathers by multi-/cross- posting on 3 different NG's. I just figure that I'm expanding my audience and have a better chance of getting my questions answered. Thanks for any help anyone can provide, Conan Kelly |
#3
![]()
Posted to microsoft.public.word.conversions,microsoft.public.word.formatting.longdocs,microsoft.public.word.newusers
|
|||
|
|||
![]()
Conan Kelly wrote:
Hello all, How do I open a text file in MS Word so that it is not bound to a paper size or margins? I have a text file that I need to import into MS Access/SQL Server. This text file runs out to column 174 in Notepad (when Word Wrap is shut off). But this text file is in a "Report" format: every 57 lines is the page header for the next page and then records follow. That is why I want to open it in Word, so I can run macros on it to delete the page headers and the summaries at the end of each section so I can import only records into Access/SQL Server. When ever I open it in Word, first the File Conversion dialog box pops up with Unicode selected. I click "OK", but then the ruler shows up at the top of the Word doc limited to 11.5" and the lines are wrapping when it gets to the right margin. I've tried changing paper size and margins but can't seem to get the 11.5" ruler to expand so the lines will quit wrapping and each record will only take up one line. I'm afraid of how that will affect my macros. They will depend heavily on finding certain text and then deleting a certain number of lines once that text is found. I would definitely be more comfortable writing/running my macros if the lines did not wrap. You should check to see if the lines are actualy wrapped or not by turning on the formatting controls. Use View, Normal, not View, Page Layout. As long as you make sure you Save it as a text file, sounds like you should choose unicode, you'll be fine. Word won't add anything to it unless you tell it to. I suspect your file in Word is probably fine as long as th eone you are opening is OK. You're just looking at it in Page Layout view, which wraps the lines for you, similar to if you typed them in without pressing Return. Displaying the format markers will tell you what's where. If you aren't sure, try pulling it into Word, select View | Normal, then Save it as a text file. Now, open it with Wordpad (or Notepad) and see if you still have the long lines; you should. It's all in how you Save the file. HTH, Pop I'm sorry if I'm ruffling some feathers by multi-/cross- posting on 3 different NG's. I just figure that I'm expanding my audience and have a better chance of getting my questions answered. That's a lot of scatter, actually. You should set follups to your favorite group and do all the reading/responses from there. Thanks for any help anyone can provide, Conan Kelly |
#4
![]()
Posted to microsoft.public.word.conversions,microsoft.public.word.formatting.longdocs,microsoft.public.word.newusers
|
|||
|
|||
![]()
"Conan Kelly" CTBarbarin at msn dot com wrote:
How do I open a text file in MS Word so that it is not bound to a paper size or margins? I have a text file that I need to import into MS Access/SQL Server. This text file runs out to column 174 in Notepad (when Word Wrap is shut off). But this text file is in a "Report" format: every 57 lines is the page header for the next page and then records follow. That is why I want to open it in Word, so I can run macros on it to delete the page headers and the summaries at the end of each section so I can import only records into Access/SQL Server. When ever I open it in Word, first the File Conversion dialog box pops up with Unicode selected. I click "OK", but then the ruler shows up at the top of the Word doc limited to 11.5" and the lines are wrapping when it gets to the right margin. I've tried changing paper size and margins but can't seem to get the 11.5" ruler to expand so the lines will quit wrapping and each record will only take up one line. I'm afraid of how that will affect my macros. They will depend heavily on finding certain text and then deleting a certain number of lines once that text is found. I would definitely be more comfortable writing/running my macros if the lines did not wrap. Hello, don't bother if Word wraps the lines. This is just a display matter and doesn't affect the file as long as it is saved as plaintext (or Unicode). Each end-of-line (actually an end-of-line + carriage-return pair) in a plaintext file shows as paragraph mark when opened in Word; each paragraph mark in Word becomes an end-of-line when saved as plaintext. It also won't affect your macros as long as you don't rely on Word's "lines" but rely on paragraphs. -- email me: change "nospam" to "w.hennings" Wilfried Hennings c./o. Forschungszentrum (Research Center) Juelich GmbH, MUT http://www.fz-juelich.de/mut/mut_home All opinions mentioned are strictly my own, not my employer's. |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to make custom paper sizes work? | Page Layout | |||
Paper size in print changes when the file is move to another computer | Page Layout | |||
prevent txt file from opening as html? | Microsoft Word Help | |||
Setup for curser location when opening a file | Microsoft Word Help | |||
opening a word document Read-Only locks the file - work around? | Microsoft Word Help |