C
Chip Dukes
First, I'm a newbie to .Net ... Any help is appreciated
So I see that one of the applications I frequently use (Adobe InDesign) can be driven using VB ... I decide to try it out ... if this works, there are many day-to-day work flow problems that I can address. First I try creating a VB executable with a simple button ... the code behind the button is
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clic
REM Hello Worl
REM Declare variable types (optional if Option Explicit is off)
Dim myInDesign As InDesign.Applicatio
Dim myDocument As InDesign.Documen
Dim myPage As InDesign.Pag
Dim myTextFrame As InDesign.TextFram
REM End of variable type declaration
myInDesign = CreateObject("InDesign.Application.CS"
REM Create a new documen
myDocument = myInDesign.Documents.Ad
REM Get a reference to the first pag
myPage = myDocument.Pages.Item(1
REM Create a text fram
myTextFrame = myDocument.TextFrames.Ad
REM Specify the size and shape of the text fram
Dim AryStringArray() As String = {"0p0", "0p0", "18p0", "18p0"
myTextFrame.GeometricBounds = AryStringArra
REM Enter text in the text fram
myTextFrame.Contents = "Hello World!
End Su
End Clas
(I added the Interop.InDesign reference to my project
I compile and run it ... no problem ... cool ... then I decide to try the same thing from an aspx page ..
First I tried something simple and just copied and pasted the code into a button placed on an aspx page ... result when I tried the page in my browser ... "Cannot create ActiveX component
I continued reading, and though nothing specifically said what the problem was I got the feeling there was a permission problem, someplace
So ... tried creating a VB class (see code below)
Imports Syste
Imports InDesig
Namespace WroxUnite
Public Class Class
Public Sub New(
End Su
Public Function runInDesign(
REM Hello Worl
REM Declare variable types (optional if Option Explicit is off)
Dim myInDesign As InDesign.Applicatio
Dim myDocument As InDesign.Documen
Dim myPage As InDesign.Pag
Dim myTextFrame As InDesign.TextFram
REM End of variable type declaration
myInDesign = CreateObject("InDesign.Application.CS"
REM Create a new documen
myDocument = myInDesign.Documents.Ad
REM Get a reference to the first pag
myPage = myDocument.Pages.Item(1
REM Create a text fram
myTextFrame = myDocument.TextFrames.Ad
REM Specify the size and shape of the text fram
Dim AryStringArray() As String = {"0p0", "0p0", "18p0", "18p0"
myTextFrame.GeometricBounds = AryStringArra
REM Enter text in the text fram
myTextFrame.Contents = "Hello World!
Return "Done
End Functio
End Clas
End Namespac
.... then calling the VB class from the button (see code below)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clic
Dim ClassTest As New WroxUnited.Class
Dim lblMessag
lblMessage = ClassTest.runInDesig
End Su
Result when I tried to test ... ... "Cannot create ActiveX component " ..
Kept reading ... found a reference that indicated that the ASPNET user account might need to be given Administrator rights ..
tried that ... same result ..
I'm obviously missing something here, but I seem to see variants of the question from several other people. Any ideas
So I see that one of the applications I frequently use (Adobe InDesign) can be driven using VB ... I decide to try it out ... if this works, there are many day-to-day work flow problems that I can address. First I try creating a VB executable with a simple button ... the code behind the button is
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clic
REM Hello Worl
REM Declare variable types (optional if Option Explicit is off)
Dim myInDesign As InDesign.Applicatio
Dim myDocument As InDesign.Documen
Dim myPage As InDesign.Pag
Dim myTextFrame As InDesign.TextFram
REM End of variable type declaration
myInDesign = CreateObject("InDesign.Application.CS"
REM Create a new documen
myDocument = myInDesign.Documents.Ad
REM Get a reference to the first pag
myPage = myDocument.Pages.Item(1
REM Create a text fram
myTextFrame = myDocument.TextFrames.Ad
REM Specify the size and shape of the text fram
Dim AryStringArray() As String = {"0p0", "0p0", "18p0", "18p0"
myTextFrame.GeometricBounds = AryStringArra
REM Enter text in the text fram
myTextFrame.Contents = "Hello World!
End Su
End Clas
(I added the Interop.InDesign reference to my project
I compile and run it ... no problem ... cool ... then I decide to try the same thing from an aspx page ..
First I tried something simple and just copied and pasted the code into a button placed on an aspx page ... result when I tried the page in my browser ... "Cannot create ActiveX component
I continued reading, and though nothing specifically said what the problem was I got the feeling there was a permission problem, someplace
So ... tried creating a VB class (see code below)
Imports Syste
Imports InDesig
Namespace WroxUnite
Public Class Class
Public Sub New(
End Su
Public Function runInDesign(
REM Hello Worl
REM Declare variable types (optional if Option Explicit is off)
Dim myInDesign As InDesign.Applicatio
Dim myDocument As InDesign.Documen
Dim myPage As InDesign.Pag
Dim myTextFrame As InDesign.TextFram
REM End of variable type declaration
myInDesign = CreateObject("InDesign.Application.CS"
REM Create a new documen
myDocument = myInDesign.Documents.Ad
REM Get a reference to the first pag
myPage = myDocument.Pages.Item(1
REM Create a text fram
myTextFrame = myDocument.TextFrames.Ad
REM Specify the size and shape of the text fram
Dim AryStringArray() As String = {"0p0", "0p0", "18p0", "18p0"
myTextFrame.GeometricBounds = AryStringArra
REM Enter text in the text fram
myTextFrame.Contents = "Hello World!
Return "Done
End Functio
End Clas
End Namespac
.... then calling the VB class from the button (see code below)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clic
Dim ClassTest As New WroxUnited.Class
Dim lblMessag
lblMessage = ClassTest.runInDesig
End Su
Result when I tried to test ... ... "Cannot create ActiveX component " ..
Kept reading ... found a reference that indicated that the ASPNET user account might need to be given Administrator rights ..
tried that ... same result ..
I'm obviously missing something here, but I seem to see variants of the question from several other people. Any ideas