COM OLE Automation bridge; property Name not supported

2014-08-28 Thread Peter Eberlein

Hi,

because aoo cannot open all Word docs without crashing 
(https://issues.apache.org/ooo/show_bug.cgi?id=125419), I wanted to let 
do WinWord the job.


I need to know the names of all bookmarks.
So StarBasic looks like this:

wordInstance = CreateObject(Word.Application)
wordDoc = wordInstance.documents.open(c:\test.docx)
For i = 1 To wordDoc.Bookmarks.Count
bookmark = doc.Bookmarks(i)
msgbox bookmark.Name 'fails
'if the property has arguments:
msgbox bookmark.hasProperty(Name) 'false [1]
msgbox bookmark.getValue(Name) 'property not supported
next




Any idea how to get the bookmarks name?
I think Name is a key word and can not be used in StarBasic.

Regards

Peter

[1] 
https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Bridge/Using_Automation_Objects_from_UNO


-
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org



Re: COM OLE Automation bridge; property Name not supported

2014-08-28 Thread Mathias Röllig

Hi Peter!


If you using the right syntax (I don't know):


For i = 1 To wordDoc.Bookmarks.Count

   ^^^

 bookmark = doc.Bookmarks(i)

  ^^^

 msgbox bookmark.Name 'fails

'yes, it must
'Option Explicit enabled?

Regards, Mathias

-
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org



Re: COM OLE Automation bridge; property Name not supported

2014-08-28 Thread Peter Eberlein

Hi Mathias,
it's only a typo, meant wordDoc.Bookmarks(i)

the error property or method not found occurs in line
 msgbox bookmark.Name

Regards

Peter

meant
Am 28.08.2014 18:03, schrieb Mathias Röllig:

Hi Peter!


If you using the right syntax (I don't know):


For i = 1 To wordDoc.Bookmarks.Count

^^^

 bookmark = doc.Bookmarks(i)

   ^^^

 msgbox bookmark.Name 'fails

'yes, it must
'Option Explicit enabled?

Regards, Mathias

-
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org




-
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org