Solved

Marking up a word document

Posted on 2003-11-12
2
372 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
2 Comments
 
LVL 7

Accepted Solution

by:
_agj_ earned 250 total points
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

771 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now