Document Name or Path is not valid error

M

Mozz

I've created some RTF files in VBA by opening up existing ones as text streams and written them back out to another text stream file. Word cannot then open up the new rtf file. I can open the file in notepad or wordpad with no problems. I have checked the original and the new one to confirm that the contents are the same.

Firstly, I hear you ask why anyone would want to do such a thing. Well, we have put text place holders into the rtfs that an application we are developing uses to insert text and when we are saving the rtfs in word some of the place holders are being split across two lines and our application cannot recognise them. My macro is designed to make sure our placeholders remain on the one line.

The files are being created using createtextfile. Is there another way to create a text file with an rtf extension that can be opened by word? I'm no VBA expert. I've learned via the help files. we are using Office 2003 sp-3.

Thanks
 

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