lotus notes & adobe indesign

Hello there,

I'm currently working on an application which needs to cummunicate with
Adobe Indesign...
I'm just not sure how to make OLE objects....
Does when I run this next LotusScript i get the following message:
Cannot create automation object...

This is the script....:

Sub Click(Source As Button)

 Dim db As NotesDatabase
 Dim myView As NotesView
 Dim myDocument As NotesDocument
 Dim myNotesItem As NotesItem
 Dim myAdv_kolom As Integer
 Dim myAdv_hoogte As Integer
 Dim myInDesign As Variant
 Dim count As Integer
 Dim myPub As Variant
 Dim myFrame As Variant
 Dim bounds (0 To 3) As String

 Set myInDesign = getObject ("", "InDesign.Application")
'This is where stuff goes wrong....!!
Set myPub = Indesign.Documents
 Set myFrame = InDesing.TextFrame

 Set db = New NotesDatabase( "", "uitgever.nsf" )
 Messagebox( db.Title )
 Set myView  = db.GetView( "advertenties" )

 Set myDocument = myView.GetFirstDocument
 count = 0

 Do Until myDocument Is Nothing
  Set myNotesItem = myDocument.GetFirstItem("adv_kolom")
  myAdv_kolom = 35 * myNotesItem.text
  Set myNotesItem = myDocument.GetFirstItem("adv_hoogte")
  myAdv_hoogte = myNotesItem.text
  Messagebox("Breedte " & myAdv_kolom & " Hoogte: " & myAdv_Hoogte)
  bounds(0) = "0p0"
  bounds(1) = "0p0"
  bounds(2) = myAdv_kolom
  bounds(3) = myAdv_hoogte
  count = count + 1
  Set myDocument = myView.GetNextDocument( myDocument )
 Loop

 Messagebox("Zoveel documenten: " & count)

End Sub

Does anybody have any ideas?
thanks in advance....

Harm de Laat




HarmDeLaatAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ghassan99Connect With a Mentor Commented:
coz the application must have been already started when u use GetObject in this way.  Use CreateObject, like this example:
Dim myInDesign As Variant
Set myInDesign = CreateObject("InDesign.Application")
0
 
HarmDeLaatAuthor Commented:
i did that already....
problem is when i need to create a document or some other object in Indesign lotus gives me the following message...:
Cannot create automation Object

This is the script i use...

thanks in advance

Sub Click(Source As Button)
      
      Dim db As NotesDatabase
      Dim myView As NotesView
      Dim myDocument As NotesDocument
      Dim myNotesItem As NotesItem
      Dim myAdv_kolom As Integer
      Dim myAdv_hoogte As Integer
      Dim myInDesign As Variant
      Dim count As Integer
      Dim myPub As Variant
      Dim myFrame As Variant
      Dim bounds (0 To 3) As String
      
      Set myInDesign = createObject("InDesign.Application")

        ' This is where things go wrong
      Set myPub = Indesign.Documents
      Set myFrame = InDesing.TextFrame
      
      Set db = New NotesDatabase( "", "uitgever.nsf" )
      Messagebox( db.Title )
      Set myView  = db.GetView( "advertenties" )
      
      Set myDocument = myView.GetFirstDocument
      count = 0
      
      Do Until myDocument Is Nothing
            Set myNotesItem = myDocument.GetFirstItem("adv_kolom")
            myAdv_kolom = 35 * myNotesItem.text
            Set myNotesItem = myDocument.GetFirstItem("adv_hoogte")
            myAdv_hoogte = myNotesItem.text
            Messagebox("Breedte " & myAdv_kolom & " Hoogte: " & myAdv_Hoogte)
            bounds(0) = "0p0"
            bounds(1) = "0p0"
            bounds(2) = myAdv_kolom
            bounds(3) = myAdv_hoogte
            count = count + 1
            Set myDocument = myView.GetNextDocument( myDocument )
      Loop
      
      Messagebox("Zoveel documenten: " & count)
      
End Sub
0
All Courses

From novice to tech pro — start learning today.