Solved

VB + Ms Word

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

740 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