LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting content of word document as per selected section

Hi All

 

I am trying to extract the content present inside the word document based on the section/heading number provided by user.

If the user provides main heading , it should extract data from all the subsections present inside main section.

If the user provides subsection heading , then it should only extract the data present in that particular section.

 

For eg :

my word document has following sections:

Section1

            1.1 

             1.2

             1.3

Section 2

          2.1

          2.2

          2.3

if user gives input as Section1 , all data present in section 1.1 ,1.2, 1,3 should be present at output.

If user gives input as 2.2 , only data present in section 2.2 should be present at output.

 

I am trying this though activex and got some of the properties/methods related to this.

However I am not able to get the final output.

Can someone please guide me which exact methods/properties i need to use to get the expected result.

 

This is what i have tried so far.

Also would like to understand does heading and section are treated differently wrt to activex properties? because I have observed that both the options are present for "Go to" method .

 

0 Kudos
Message 1 of 9
(2,925 Views)

What do you mean by "section"?  Typically, bookmarks are used to allow you to jump to a specific point in a document. 

aputman
0 Kudos
Message 2 of 9
(2,912 Views)

Hi

 

When I am referring "Section " I mean to access the particular data present in word document under certain heading.

I have attached sample Word document here for reference.

If we refer generic word document , it has certain heading/sections present inside it ,under which the content of is present. I need to access these heading/sections to get the data under it.

 

In the document attached , I am trying to access the data present under heading/Section1 or heading 1.1 or any other heading .

Based on the heading number , the VI should extract only the data which is present inside it.

If it is heading 1(which also has heading 1.1 and 1.1.1) then in that case , it should extract data present under all the three heading. If it is last heading(i.e which do not have any further subheading) should extract only the data present under it.

 

I will give a try for bookmarks too.

Please suggest if there are any more pointers towards achieving this.

0 Kudos
Message 3 of 9
(2,899 Views)

Those aren't technically "headings" as Word would define them.  Let me explain.

 

On the View tab, turn on the Navigation Pane and one of the tabs in that window allows you to view the document structure.  Your uploaded document does not have any headings.  

 

Headings are added using Styles on the Home tab.  When you select a "heading" (as you are defining it) and assign one of the heading styles, the navigation pane will be updated to show this new heading.  You can demote and promote headings to be parent/child, etc.  You can also right click a heading in the navigation pane and select a heading and it's contents (including child headings).  

 

Now your task is to figure out how to do this using ActiveX.  

aputman
0 Kudos
Message 4 of 9
(2,890 Views)

Hi

 

Thank you for the information.

Let me rephrase what i am trying to do.

I am basically trying to access heading(which is defined under navigation pane also as mentioned by you) or the cross numbered items present in word document(like the one which is present in previous attachment).

The words documents which I am going to access are multiple and do not have any fixed defined formats. That is the reason some document may have heading and some may have just the cross numbered items.

I have figured out how to access the crossnumbered item/heading through activex which is done in attached VI.

however after accessing the respective heading/cross numbered item how to get the data present under it is where I am stuck right now.

 

I will try to figure out if i can find anything.

0 Kudos
Message 5 of 9
(2,878 Views)

Did you get it?

0 Kudos
Message 6 of 9
(2,769 Views)

yes....i was able to access the content present under a particular section or heading through activex controls .

Thank you!!

0 Kudos
Message 7 of 9
(2,748 Views)

Just saying that you were able to do it is not helpful to others that may be having the same issue.  Can you share a snippet?

aputman
0 Kudos
Message 8 of 9
(2,734 Views)

Adding a snippet here how I achieved it through activex!!

 

 

0 Kudos
Message 9 of 9
(2,693 Views)