Delete carriage return Word VBA

C

chrissurtees

I need to write text into a text file without including the carriag
return or alternatively deleting it afterwards. Thanks for any help.
My script thus far is:

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\temp\CaseNumber.txt", True)

a.WriteLine ("This is text")

a.Clos
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Chris,

You can use Edit>Replace to replace the carriage returns (^p) with either
nothing or a space. You can get the necessary code by recording a macro of
the action. The code so recorded can however be stripped down quite a bit
and still do all that you want.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top