Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 14th, 2006, 02:27 PM
Authorized User
Join Date: Sep 2006
Location: , IN, USA.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Extract data from Word Document(RTF format)

OK. This is the scoop. I have a folder with around 200 documents residing in it. I need to open each document(through Access 2003) and extract the customer name (always on the 4th line of the doc) so I can link these documents with their respective customers.

Good news. I can loop thru the folder and open each document in MS Word. Bad news. I cannot find an example of extracting info from a Word Document. Note: Nothing is Mail Merged in these docs. Any suggestions would be greatly appreciated.


  #2 (permalink)  
Old September 15th, 2006, 11:01 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

Okay, I am probably going about this the wrong way, but if you package this script, it will read all the lines in the rtf file as though it were a text file.

Lines/paragraphs with text start with "\par", but you may not get anything useful from this technique:

i = 1
Const ForReading = 1
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = ObjFSO.OpenTextFile("C:\Sample1.rtf", ForReading)
Do Until objFile.AtEndOfStream
    sValue = objFile.ReadLine
    WScript.Echo sValue
i = i + 1
WScript.Echo sName

Hope this helps somehow.

  #3 (permalink)  
Old September 19th, 2006, 07:52 AM
Authorized User
Join Date: Sep 2006
Location: , IN, USA.
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts

Goal!....Goooooooooooooooooal! Goooooooooooooooooooooal!
Goal Goal Goal.

It worked. Muchas Garcia!.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract embedded documents in the word document ayyanarj General .NET 0 August 31st, 2007 12:32 AM
open word document and insert data PorcupineRabbit Visual Basic 2005 Basics 1 August 9th, 2007 06:31 PM
Extracting data from Word Document (RTF) PaulJH BOOK: Access 2003 VBA Programmer's Reference 0 September 14th, 2006 02:19 PM
showing header and footer on RTF document AmolVChaudhari XSLT 0 July 17th, 2006 09:04 AM
how to extract contents of an e-mail in html/rtf mogli PHP How-To 5 September 15th, 2004 04:25 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.