[AccessD] Scrape Word Part II

MartyConnelly martyconnelly at shaw.ca
Fri Jun 10 11:31:22 CDT 2005


Just as a matter of interest this will be easy to do in the new Office 
12 XML word formats
you just write an XSLT to pick out the relevant bits. According to Brian 
Jones MS Word Project
Manager at this week's TechED. Microsoft will backward patch most 
versions of word
 to handle or at least read this new format

http://blogs.msdn.com/brian_jones/archive/2005/06/08/426818.aspx#comments

Bob Heygood wrote:

>thanks Jim.
>I have looked before at Helen's code. Lots of great stuff there.
>
>bob
>
>
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com
>[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Hale, Jim
>Sent: Wednesday, June 08, 2005 8:17 AM
>To: 'Access Developers discussion and problem solving'
>Subject: RE: [AccessD] Scrape Word Part II
>
>
>At the very bottom of this link Helen Feddema has some code that may help
>you.
>http://www.helenfeddema.com/CodeSamples.htm
>
>Jim Hale
>
>-----Original Message-----
>From: Bob Heygood [mailto:bheygood at abestsystems.com]
>Sent: Wednesday, June 08, 2005 8:35 AM
>To: Access Developers discussion and problem solving
>Subject: [AccessD] Scrape Word Part II
>
>
>Hello to the list,
>
>Well, my project is alive again. This time I have the luxury of being able
>to create the Word document from which I need to cull the info. I still need
>to have a Word table but I can create bookmarks or whatever within the table
>in the document.
>To recap I need to import 10 pieces of text from a Word document and store
>them in a mdb table.
>Jim Hale's code below worked really good except that we were pressed for
>time and did not ever get it to work in all areas of the Word doc.
>So my first question is how to search the Word doc to find the text,
>bookmarks, fields, custom properties or ????
>
>
>TIA,
>
>Bob Heygood
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com
>[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Hale, Jim
>Sent: Monday, April 18, 2005 8:54 AM
>To: 'Access Developers discussion and problem solving'
>Subject: RE: [AccessD] Scrape Word
>
>
>Whatever it takes to get the job done! Sorry I couldn't be more help.
>Jim Hale
>
>-----Original Message-----
>From: Bob Heygood [mailto:bheygood at abestsystems.com]
>Sent: Monday, April 18, 2005 10:09 AM
>To: Access Developers discussion and problem solving
>Subject: RE: [AccessD] Scrape Word
>
>
>Thanks Jim
>I finally just ran the job as it took about 4 hours to process 256
>documents.
>it is a one time deal and the customer needed to have the results.
>
>your help was fantastic.
>
>bob
>
>
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com
>[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Hale, Jim
>Sent: Friday, April 15, 2005 3:18 PM
>To: 'Access Developers discussion and problem solving'
>Subject: RE: [AccessD] Scrape Word
>
>
>I'll look at it some more on Monday. You might examine the selection object
>in the Word application. It has numerous properties and methods one or more
>of which should do the trick.
>Jim Hale
>
>-----Original Message-----
>From: Bob Heygood [mailto:bheygood at abestsystems.com]
>Sent: Friday, April 15, 2005 4:52 PM
>To: Access Developers discussion and problem solving
>Subject: RE: [AccessD] Scrape Word
>
>
>yes in a table cell.
>again your code is working super.
>but only grabs the first word, sometimes there is more than one word in the
>cell, and I would like to capture all of them.
>if you have thought, I would welcome it.
>
>
>again I tried to manipulate the code further but it acts very erratic when
>in a table cell.
>
>thanks for the great help.
>
>bob
>
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com
>[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Hale, Jim
>Sent: Thursday, April 14, 2005 12:53 PM
>To: 'Access Developers discussion and problem solving'
>Subject: RE: [AccessD] Scrape Word
>
>
>So the data you want (including the search string) is in a table cell? In
>the code I sent you delete
>   wd.Selection.Start = wd.Selection.End
>   Call wd.Selection.EndOf(wdSentence, wdExtend)
>
>and replace with
>   wd.Selection.Next(Unit:=wdWord, Count:=1).Select
>
>Or if the entire string is returned you can replace the search string with
>an empty string "" using the following function:
>
>Function ReplaceString(strTextIn As String, strFind As String, strReplace As
>String, fCaseSensitive As Boolean) As String
>
>  Dim strTmp As String
>  Dim intPos As Integer
>  Dim intCaseSensitive As Integer
>
>  intCaseSensitive = IIf(fCaseSensitive, 2, 1)
>
>  strTmp = strTextIn
>  intPos = InStr(1, strTmp, strFind, intCaseSensitive)
>
>  Do While intPos > 0
>    strTmp = Left$(strTmp, intPos - 1) & strReplace & Mid$(strTmp, intPos +
>Len(strFind))
>    intPos = InStr(intPos + Len(strReplace), strTmp, strFind,
>intCaseSensitive)
>  Loop
>
>  ReplaceString = strTmp
>
>End Function
>
>Jim Hale
>
>
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada






More information about the AccessD mailing list