rusty.hammond at cpiqpc.com
rusty.hammond at cpiqpc.com
Fri Jul 8 15:41:38 CDT 2005
Arthur, If the file you're reading is just a simple text file, then the following should work: Function ImportTextFileIntoVar() Dim strTextLine Dim strFileText As String Dim strFileName As String strFileName = "i:\test.txt" Open strFileName For Input As #1 Do While Not EOF(1) Line Input #1, strTextLine strFileText = strFileText & vbCrLf & strTextLine Loop Close 1 End Function Rusty -----Original Message----- From: Arthur Fuller [mailto:artful at rogers.com] Sent: Friday, July 08, 2005 2:52 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Read the contents of a file into a memvar I need to do what the subject says. The file might possibly be 1000 chars but more likely fewer. What I would ideally like to do is this: Dim myText as string Dim strSourceFile as string strSourceFile = xxxx myText = ReadFile( strSourceFile ) And then, once I am done, post said text to a Word bookmark... but that part is easy. TIA, Arthur -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com ********************************************************************** WARNING: All e-mail sent to and from this address will be received, scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc. corporate e-mail system and is subject to archival, monitoring or review by, and/or disclosure to, someone other than the recipient. **********************************************************************