auto copy text file into doc

S

Sandy Eastman

I have a text file that is created every morning. Unfortunately I have users
who don't know enough to close a text file when they are done reading it. If
it is left open over night, then the next morning the new updated file can't
be created as the old file is locked.
I was hoping to make a word template that would use "Document_Open" to copy
the text file into a word document and when the user closed the document,
kill it.

Can someone help me with this.
 
J

Jezebel

Dim pFileName as long

pFileNum = freefile
Open MyTextFile for input as #pfilenum
Activedocument.Range.InsertAfter input(LOF(#pfilenum), #pfilenum)
close #pfilenum
 
S

Sandy Eastman

Thanks for pointing me in the right direction.


Jezebel said:
Dim pFileName as long

pFileNum = freefile
Open MyTextFile for input as #pfilenum
Activedocument.Range.InsertAfter input(LOF(#pfilenum), #pfilenum)
close #pfilenum








it.
 

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