I'm trying to create a new AutoText via API, but it doesn't work. I've
copy'n'pasted the example from the Dev Guide and it throws a
RuntimeException (with no detail message) on the call to
XAutoTextGroup.insertNewByName(). I've tried creating an AutoText via
Basic, but it has the same problem. Below is my code. You need to
create a Bookmark "Test" for it to "work".

Can someone tell me what's the problem?

Matthias

Sub Main
  doc = ThisComponent

  autoTextContainer = createUnoService("com.sun.star.text.AutoTextContainer")
  if autoTextContainer.hasByName("TempGroup1") then
    autoTextContainer.removeByName("TempGroup1")
  end if

  atgroup = autoTextContainer.insertNewByName("TempGroup1")
  range = doc.Bookmarks.getByName("Test").Anchor
  atgroup.insertNewByName("T","Test",range)

End Sub

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to