Solved

VB + Ms Word

Posted on 2002-07-11
1
223 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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

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

8 Experts available now in Live!

Get 1:1 Help Now