[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Access VBA to search word file text and extract

Asked by traciwho in Access Coding/Macros, Microsoft Word, Access Reports

Tags: Access, Word, VBA

I'm not very knowledgeable of VB, but I've learned a lot from searching these forums.  However, I can't find a solution for this one, so here goes:

We are reformatting a huge number of Word documents.  Some of the text in the old documents will be the same in the new, and I'm trying to make it as easy as possible for SOMEONE ELSE to reformat these.  I've created a database with certain information that will be inserted via bookmarks, but I'd like to programatically open the old doc, find the text (there are no bookmarks, but naming convention pretty good), copy it and insert either into an unbound access field to insert into new document via bookmark OR straight into new document from old via bookmark.  

So, for example:  in my old doc, OPSPRO111.doc, I'd like to find the text after "SCOPE" (but before "SAFETY AND HEALTH") and copy it into either an Access Field or Word file.   Please see attached file, and the code I have thus far, which works for inserting the bookmarks.  As of yet the code doesn't have anything to do with saving the file either (so that would be a big help too!)  I'm going on vacation next week and really need to have this done prior to that so I would really appreciate your help!!!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
Private Sub Command1_Click()
On Error GoTo Err_Command1_Click
 
    Dim objWord As word.Application
 
 
    'Start Microsoft Word
    Set objWord = CreateObject("Word.Application")
 
    With objWord
        'Make the application visible.
        .Visible = True
 
        'Open the document.
        Set doc = .Documents.Open("\\shofps02\tsnewell$\test.doc", , False)
 
        'Move to each bookmark and insert text from the form.
        .ActiveDocument.Bookmarks("Forename").Select
        .Selection.Text = (CStr(Forms!export!Forename))
        .ActiveDocument.Bookmarks("Surname").Select
        .Selection.Text = (CStr(Forms!export!Surname))
       
    End With
 
 
    objWord.Quit
    Set objWord = Nothing
    Exit Sub
    
Exit_Command1_Click:
    Exit Sub
 
Err_Command1_Click:
    MsgBox Err.Description
    Resume Exit_Command1_Click
    
End Sub
Attachments:
 
word doc with sample text to select and copy from
 
[+][-]08/11/09 03:58 PM, ID: 25074311Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Access Coding/Macros, Microsoft Word, Access Reports
Tags: Access, Word, VBA
Sign Up Now!
Solution Provided By: GrahamSkan
Participating Experts: 2
Solution Grade: B
 
[+][-]08/11/09 03:16 PM, ID: 25074053Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/11/09 03:17 PM, ID: 25074063Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/11/09 03:20 PM, ID: 25074082Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/11/09 03:51 PM, ID: 25074269Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/11/09 04:01 PM, ID: 25074342Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/11/09 07:59 PM, ID: 25075402Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/12/09 12:20 AM, ID: 25076327Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08/14/09 11:37 AM, ID: 25101036Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/24/09 08:03 AM, ID: 25169030Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/24/09 08:05 AM, ID: 25169049Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/24/09 08:07 AM, ID: 25169070Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625