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
Auslesen von Bookmarks aus einem Wordfile
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Auslesen von Bookmarks aus einem Wordfile
Have you tried this ?
For j := 1 to oWord:ActiveDocument:Bookmarks:Count()
AADD(aTextmarke, oWord:ActiveDocument:Bookmarks( j - 1 ):Name)
Next j
For j := 1 to oWord:ActiveDocument:Bookmarks:Count()
AADD(aTextmarke, oWord:ActiveDocument:Bookmarks( j - 1 ):Name)
Next j
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Auslesen von Bookmarks aus einem Wordfile
Also try this
AADD(aTextmarke, oWord:ActiveDocument:Bookmarks( j + 1 ):Name)
What error do you get ? Please copy it here, thanks
AADD(aTextmarke, oWord:ActiveDocument:Bookmarks( j + 1 ):Name)
What error do you get ? Please copy it here, thanks
Re: Auslesen von Bookmarks aus einem Wordfile
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
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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Auslesen von Bookmarks aus einem Wordfile
Then it means that your code is right:
What error do you get with it ?
Code: Select all
For j := 1 to oWord:ActiveDocument:Bookmarks:Count()
AADD(aTextmarke, oWord:ActiveDocument:Bookmarks(j):Name)
Next j
Re: Auslesen von Bookmarks aus einem Wordfile
Hallo,
the compiler can't work with:
CODE: SELECT ALL EXPAND VIEW
syntax error at 'ALL'
the compiler can't work with:
CODE: SELECT ALL EXPAND VIEW
syntax error at 'ALL'
Re: Auslesen von Bookmarks aus einem Wordfile
in addition:
I'm using xHarbour 1.2.1
Hoschik
I'm using xHarbour 1.2.1
Hoschik
Re: Auslesen von Bookmarks aus einem Wordfile
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
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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: