FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index All products support Auslesen von Bookmarks aus einem Wordfile
Posts: 7
Joined: Sat May 23, 2015 07:59 AM
Auslesen von Bookmarks aus einem Wordfile
Posted: Sat May 23, 2015 02:45 PM

Hallo,
möchte die Bookmarks (Textmaken) eines Word Dokumentes ermitteln und finde den entsprechenden Aufruf nicht, z.B. durch:

For j := 1 to oWord:ActiveDocument:Bookmarks:Count()
AADD(aTextmarke, oWord:ActiveDocument:Bookmarks(j):Name)
Next j

Das funktioniert nicht! Zwar liefert oWord:ActiveDocument:Bookmarks:Count() die richtige Anzahl, aber oWord:ActiveDocument:Bookmarks(j):Name ist offensichtlich falsch.
Weiß jemand, wie es heißt?
Gruß Hoschik

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Auslesen von Bookmarks aus einem Wordfile
Posted: Sun May 24, 2015 07:33 AM

Have you tried this ?

For j := 1 to oWord:ActiveDocument:Bookmarks:Count()
AADD(aTextmarke, oWord:ActiveDocument:Bookmarks( j - 1 ):Name)
Next j

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Auslesen von Bookmarks aus einem Wordfile
Posted: Sun May 24, 2015 07:35 AM

Also try this

AADD(aTextmarke, oWord:ActiveDocument:Bookmarks( j + 1 ):Name)

What error do you get ? Please copy it here, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7
Joined: Sat May 23, 2015 07:59 AM
Re: Auslesen von Bookmarks aus einem Wordfile
Posted: Sun May 24, 2015 09:01 AM

Hallo,
the error I'm getting is:
[3232] -> Error Word.Application:ACTIVEDOCUMENT/0 S_OK: BOOKMARKS Arguments: ( [ 1] = Type: N Val: 2) >NIL<
[3232] -> Error at ...: TOLEAUTO:BOOKMARKS(0) in Module: >../../win32ole.prg<
when i wrote
AADD(aTextmarke, oWord:ActiveDocument:Bookmarks(j+1):Name)
or
AADD(aTextmarke, oWord:ActiveDocument:Bookmarks(j-1):Name)
Gruß Hoschik

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Auslesen von Bookmarks aus einem Wordfile
Posted: Sun May 24, 2015 09:13 AM
Then it means that your code is right:

Code (fw): Select all Collapse
For j := 1 to oWord:ActiveDocument:Bookmarks:Count()
AADD(aTextmarke, oWord:ActiveDocument:Bookmarks(j):Name)
Next j


What error do you get with it ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7
Joined: Sat May 23, 2015 07:59 AM
Re: Auslesen von Bookmarks aus einem Wordfile
Posted: Sun May 24, 2015 09:43 AM

Hallo,
the compiler can't work with:
CODE: SELECT ALL EXPAND VIEW
syntax error at 'ALL'

Posts: 7
Joined: Sat May 23, 2015 07:59 AM
Re: Auslesen von Bookmarks aus einem Wordfile
Posted: Sun May 24, 2015 10:22 AM

in addition:
I'm using xHarbour 1.2.1
Hoschik

Posts: 7
Joined: Sat May 23, 2015 07:59 AM
Re: Auslesen von Bookmarks aus einem Wordfile
Posted: Sun May 24, 2015 09:47 PM

Hallo,
the following lines work well:

For j := 1 to oWord:ActiveDocument:Bookmarks:Count()
AADD(aBM, oWord:ActiveDocument:Bookmarks:Item(j):Name)
Next j

Thank you four your help
Kind regards, Hoschik

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Auslesen von Bookmarks aus einem Wordfile
Posted: Sun May 24, 2015 10:09 PM

very good :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion