Solved

VB + Ms Word

Posted on 2002-07-11
1
226 Views
Last Modified: 2010-05-02
Greetings,

I need to do the following :

1 - I have a Word document that has on its begining a table of Contents

an example would be like this

1 - nnnnn
 1-1 bbb
 1-2 hhhhh
  1-2-1 yyyyy

2 -mmmmm

3 - FFFFF
3-1 ttttt

and so on
.
.
.
.
.
.

What I need is to read this table of contents using VB ( loop through it and save it in the DB)


II - Split the document into section each section will beaccording to the Sections(1,1-1,1-2,1-1-1,...) defined in the Table of Contents and save each splitted part into a file

Can u Please help and please provide me with good links on how to use VB to read Word documents.

More Points for complete code

thnx a lot
0
Comment
Question by:zeon1234
1 Comment
 
LVL 2

Accepted Solution

by:
chops123 earned 200 total points
ID: 7145650
Assuming that the TOC 'Contents' in the Word document are in a predifined format and the format doesnt chnage,you can read the word file,parse the contents of the page and strip out the required sections.

For this you need an identifier on which you would base your parsing on.In this case I beleive you have to rely on vbCrLf (Carriage Return-Line Feed)

Use the instr and Mid functions in VB to go about your parsing.

Regards
KC
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…

856 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