Auslesen von Bookmarks aus einem Wordfile

Auslesen von Bookmarks aus einem Wordfile

Postby Hoschik » Sat May 23, 2015 2: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
Hoschik
 
Posts: 7
Joined: Sat May 23, 2015 7:59 am

Re: Auslesen von Bookmarks aus einem Wordfile

Postby Antonio Linares » Sun May 24, 2015 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Auslesen von Bookmarks aus einem Wordfile

Postby Antonio Linares » Sun May 24, 2015 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Auslesen von Bookmarks aus einem Wordfile

Postby Hoschik » Sun May 24, 2015 9: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
Hoschik
 
Posts: 7
Joined: Sat May 23, 2015 7:59 am

Re: Auslesen von Bookmarks aus einem Wordfile

Postby Antonio Linares » Sun May 24, 2015 9:13 am

Then it means that your code is right:

Code: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Auslesen von Bookmarks aus einem Wordfile

Postby Hoschik » Sun May 24, 2015 9:43 am

Hallo,
the compiler can't work with:
CODE: SELECT ALL EXPAND VIEW
syntax error at 'ALL'
Hoschik
 
Posts: 7
Joined: Sat May 23, 2015 7:59 am

Re: Auslesen von Bookmarks aus einem Wordfile

Postby Hoschik » Sun May 24, 2015 10:22 am

in addition:
I'm using xHarbour 1.2.1
Hoschik
Hoschik
 
Posts: 7
Joined: Sat May 23, 2015 7:59 am

Re: Auslesen von Bookmarks aus einem Wordfile

Postby Hoschik » Sun May 24, 2015 9: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
Hoschik
 
Posts: 7
Joined: Sat May 23, 2015 7:59 am

Re: Auslesen von Bookmarks aus einem Wordfile

Postby Antonio Linares » Sun May 24, 2015 10:09 pm

very good :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to All products support

Who is online

Users browsing this forum: No registered users and 9 guests