Marking up a word document

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
LVL 1
d_glennAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

_agj_Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.