Bob Heygood
bheygood at abestsystems.com
Fri Jun 10 09:01:24 CDT 2005
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 *********************************************************************** The information transmitted is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error please contact the sender and delete the material from any computer. As a recipient of this email, you are responsible for screening its contents and the contents of any attachments for the presence of viruses. No liability is accepted for any damages caused by any virus transmitted by this email. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com *********************************************************************** The information transmitted is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error please contact the sender and delete the material from any computer. As a recipient of this email, you are responsible for screening its contents and the contents of any attachments for the presence of viruses. No liability is accepted for any damages caused by any virus transmitted by this email. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com *********************************************************************** The information transmitted is intended solely for the individual or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this email in error please contact the sender and delete the material from any computer. As a recipient of this email, you are responsible for screening its contents and the contents of any attachments for the presence of viruses. No liability is accepted for any damages caused by any virus transmitted by this email.