Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
InDesign COM not supported?
#5
Running as user seems to be the trick--partially. (._getactive does not work but ._create does--when running as user).

The following code runs without error--yay, partial success! But, it also does nothing. (It should delete selected text.)

Code:
Copy      Help
IDispatch oidApp._create("InDesign.Application")
IDispatch oidDoc=oidApp.ActiveDocument
out oidApp.Selection.Count
oidApp.Selection[0].Delete

Interestingly it does output the correct count of currently selected items, but does not delete them.

Here's working VB code:
Code:
Copy      Help
Dim oidApp As New InDesign.Application
  
  Dim oidDoc As InDesign.Document
  Set oidDoc = oidApp.ActiveDocument
  
  oidApp.Selection(1).Delete


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)