Solved

VB + Ms Word

Posted on 2002-07-11
1
229 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
[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
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Suggested Courses
Course of the Month5 days, 19 hours left to enroll

626 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