PDA

View Full Version : Solved: Copy text from specific pages with VBA



truckman
08-18-2004, 01:20 AM
hello all
well i am new comer to the world of VBA so please bear with me.I have to write some macros in MS Word through which i will be exporting the text to a PHP page for further processing.The PHP part is ok except for one thing, the problems are as follow...

1. How can i get the page numbers of the word document in VBA.
2. Is it possible to read the text of a document page wise.

3. The new lines of word document are not identified by php.it display it as a single line....

ne suggestions, comments, tricks, tipps..... ne thing

Regards

truckman
08-18-2004, 01:53 AM
hi
well getting page numbers in damn too easy....

it is like

Dim pages as Long
pages = Selection.Information(wdNumberOfPagesInDocument)


ok but now i dont know how to jump to a particular page and get its text....

:dunno :confused:

TonyJollans
08-18-2004, 04:44 AM
Hi truckman,

To select the text in a page you can use ..


Selection.GoTo(wdGoToPage, , pagenumber).Bookmarks("\Page").Range.Text

Getting text of individual lines depends a bit on how your text is structured - Word, as a word processor, reflows text over lines depending on available space, but there is a built-in "\Line" bookmark similar to the "\Page" one above which may be of help. If you post back with a few more details I may be able to help a bit more.

truckman
08-18-2004, 05:25 AM
Hello Tony

Thanx a lot buddy, it is working.hopefully i wont be having any problem....but you never know....so if i will have , will come back here again.....

Thanx