Solved

Marking up a word document

Posted on 2003-11-12
2
378 Views
Last Modified: 2010-05-01
Hello,

This isn't necessarily a VB question, but I'm hoping the experts here may have some ideas for me.

I have a client who receives word documents from many of their clients.  These documents they receive are not consistently formatted.  When they receive the doc, they have to manually copy and paste information from the doc into a separate text file.

The customer is looking for a way to streamline their process.  Any solution I provide has to use the Word document as a starting point.  They have no way of controlling the files they recieve.

My hope is that there is some way within Word to be able to highlight a block of text and mark it with a tag that identifies it as a certain piece of information.  Then I would write some code to parse through the document and generate the text file based on the tags that have been marked in the document.

I have a few questions:
- Is what I am talking about possible?
- If so, can you point me in the direction of how to start this?
- If not, do you have any other ideas of how to solve their problem?

Thank you very much for your help in this matter.

DG
0
Comment
Question by:d_glenn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
_agj_ earned 250 total points
ID: 9739278
this code, when used in vba will print out a list of hightlighted sections, one after the otehr

Dim sent As String
Dim i As Long

For i = 1 To ThisDocument.Words.Count
If ThisDocument.Words(i).HighlightColorIndex <> wdNoHighlight Then
    If ThisDocument.Words(i + 1).HighlightColorIndex = wdNoHighlight Then
        sent = sent & " " & ThisDocument.Words(i)
        Debug.Print sent
        sent = ""
    Else
        sent = sent & " " & ThisDocument.Words(i)
    End If
End If

Next i

to use from vb, include a word reference and replace thisdocument with :
dim doc as document
set doc = Word.Application.Documents.Open(FileName)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question