Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Development Guidance

New Here ,
Oct 29, 2008 Oct 29, 2008
Hi.

I work with Microsoft NAV (formerly Navision) and a requirement has come up to somehow interface NAV with InDesign. The task is to produce (fairly simple) product tags based on data within NAV (item number, description, dimensions, price, etc.) The tags are currently being produce 'by hand'.

InDesign has an obviously rich and varied development environment - so much so that it's a bit overwhelming to the uninitiated. What I am looking for are some 'high-level' suggestions on how to 'marry' NAV with InDesign. By high-level, I mean just point me in the right direction and I'll do the had work of figuring it out. I'm just hoping to avoid wasting a lot of time going down blind alleys.

Thanks in advance for any pointers you may have.

Bob
TOPICS
Scripting
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 29, 2008 Oct 29, 2008
Hi Bob,

Can you provide some links that explain NAV? Thanks.

Rick Quatro
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 29, 2008 Oct 29, 2008
from Google:

http://en.wikipedia.org/wiki/Microsoft_Navision

robin

--
www.adobescripts.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 29, 2008 Oct 29, 2008
Hi Bob,

I'll have to ask some questions to figure out the best approach. The first question is: does NAV support VBA/VBScript?

Thanks,

Ole
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 29, 2008 Oct 29, 2008
Hi Olav.

I'm not sure how to answer that - but I'll try.

The dev environment in NAV gives me access to automation objects - if that's the right term. For example, I can boot an instance of Excel and manipulate it through it's "object" & method API which is, I guess, VB. I'm vague on the terms because I have done this for years on a Windows platform but in a non MS programming environment through open-source COM extensions to Tcl/Tk. Being 'off the grid' for so long, I just got used to getting things to work without much documentation or knowing the correct terms for this environment.

NAV seems to provide access to the full breadth of the MS automation/Com environment in a pretty seamless (but woefully undocumented) way. So, I'm fairly hopefull (and fearless) of taking this approach.

Also, it provides XML import & import functionality - which may be of benefit here. However, it is so tightly wrapped (and badly documented) that my hands are tied to an extent I'm really not comfortable with it.

Does any of this help?

Bob
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Oct 29, 2008 Oct 29, 2008
Hi Bob,

I think it’s possible to do with VB6. A couple of years ago I was experimenting with InDesign and Access. I could get data from InDesign — e.g. user name — and write it directly into a database. I don’t know what NAV is but it looks like a kind of database application.

Kasyan
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 07, 2008 Nov 07, 2008
NAV is an ERP application from Microsoft. (Think *huge* accounting system.)

In the development environment I can create variables of type 'Automation'.

The GUI then provides a list of the installed automation servers. In the list is 'Adobe InDesign CS3 Type Library'.

When that is chosen, the class list is populated and I choose 'Application'.

In the code, I use the 'create' command with that Automation variable to boot an instance of the application. This is the same as I would use for Excel - and it work's just fine with it.

But, when I try to boot InDesign I get the error:

Could not create an instance of the OLE control or Automation server identified by the GUID={666F676B-7790-4B6F-B691-EC43C6F94C18} 1.0:{296CAEB5-C99C-4B3E-9359-6E7D6EAE71FC}:'Adobe InDesign CS3 Type Library'.Application. Check that the OLE control or Automation server is correctly installed and registered.

Any ideas?

Thanks in advance.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 07, 2008 Nov 07, 2008
Hi Bob,

Did you use something like this:

Set myInDesign = CreateObject("InDesign.Application.CS3"

If that doesn't work, try the type library registration shown in:

http://www.adobeforums.com/webx/.3c064bf7/13

Thanks,

Ole
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 07, 2008 Nov 07, 2008
Hi Olav.<br /><br />My problem here is that I'm not using Visual Basic. While NAV is an MS product, it's heritage is not. So, the development environment, syntax, etc. are quite different. <br /><br />I have opened a support incident with the MS NAV team, and their response so far has been to "make sure the OCX or dll is registered". The problem is, I have no idea which dll needs registering. ALso, since the InDesign type library classes appear in the NAV dev delopment GUI, I would think that it was already there. ...?<br /><br /><Rock> me <Hard Place><br /><br />Bob
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 07, 2008 Nov 07, 2008
Hi Bob,

When you said, "This is the same as I would use for Excel - and it work's just fine with it."

I guess I was thinking that NAV uses VBA. But I guess you probably meant going from NAV to Excel...right? What does the line look like in NAV for Excel?

What you need to register is the "Resources for Visual Basic.tlb"--where, exactly, varies. The best thing to do is search for it.

<Rock>Bob<crowbar>Ole<Hard Place>:-)

Thanks,

Ole
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 07, 2008 Nov 07, 2008
Here is sample source that boots Excel from NAV:

// xlApp is Automation variable, Excel Application
// xlLogSheet is Automation variable, Excel Sheet
// etc.

CREATE(xlApp);
xlBook := xlApp.Workbooks.Add(-4167);
//
xlLogSheet:= xlBook.Sheets.Add;
xlLogSheet.Name('Messages');
ExcelCellSet(xlLogSheet,1,'A','Line');
ExcelCellSet(xlLogSheet,1,'B','Message');
//
xlErrorSheet:= xlBook.Sheets.Add;
xlErrorSheet.Name('Errors');
ExcelCellSet(xlErrorSheet,1,'A','Line');
ExcelCellSet(xlErrorSheet,1,'B','Error');

etc.
----------------------
Function ExcelCellSet(Sheet : Automation "'Microsoft Excel 11.0 Object Library'.Worksheet";Row : Integer;Col : Text[30];Value : Text[128])
Sheet.Range(Col+FORMAT(Row)).Value := Value;
----------------------

So, I can use the VB documentation to determine the methods & properties to manipulate, but the environment is quite different. For example, the specifics of variable declarations (type, length, etc.) are all buried in the GUI (except in the function signatures, like above).

Bob
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 07, 2008 Nov 07, 2008
Hi Bob,

If you run into a brick wall working with InDesign via NAV, you might try pushing data out of NAV to XML (or some other format), and then use InDesign scripting to import the XML data into InDesign. It's not as elegant but it may be more straightforward scripting-wise.

Rick Quatro
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 10, 2008 Nov 10, 2008
Ole: I have seen other references here to the file "Resources for Visual Basic.tlb". I found it on my system, but you can't 'register' it using regsvr32 because it's nor a dll or ocx. So ... I really don't know what to do with it. (Plus, I'm not using Visual Basic.)

Rick: You are probably right, there's only so much time I can waste on the Automation route. I do have XML import/export capabilities in NAV, and know them well. So now the hurdles would be to identify the elements I need to export, and how to script ID to take a given 'template' file and apply the XML data to it. Can you suggest the simplest way to get a 'Hello World' up and running in this context?

Many (many!) thanks to you both.

Bob
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 10, 2008 Nov 10, 2008
Hi Bob,

I am an InDesign scripting newbie, so I will defer to others on the list. My expertise is in the FrameMaker/FrameScript arena.

Rick
rick at frameexpert dot com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 10, 2008 Nov 10, 2008
Bob,

The basic process is to import an XML file and then to place that XML into one or more text frames.

The details of how best to approach the problem depend, in some part, on the data and how it will be formatted in InDesign (will any of the data be in tables, for example).

While you can put the time into learning how to do this on your own, I would recommend that you engage a consultant to help you through the first one. Once you see how to do it, it will make sense and seem relatively straight forward.

I am available to help, as are a number of other folks who frequent this forum.

Regards

Bob Stucky
bob.stucky@starband.net
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 12, 2008 Nov 12, 2008
Hi Bob H.,

Can you do TCP socket communications in your environment? I ask because I have written an InDesign Plug-In that allows an application (or whatever) to communicate with InDesign via TCP/IP. The way it is currently used is to pass in script text or a filepath to a script (JavaScript, AppleScript, or VBScript), and then have the Plug-In run the script. I've used my Plug-In for a number of projects of my own, and it works quite well.

Also, I agree with Bob Stucky when he mentioned getting some scripting help. Unless you have some experience with InDesign, you would likely benefit from the help of someone with InDesign scripting experience. From your comments, I think that the coding part would be a quick learn for you; however, the InDesign Scripting API takes some time to learn.

If you want to discuss the Plug-In, please send me an email. You can find my email address by clicking on my name in this message.

-- Jim
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 13, 2008 Nov 13, 2008
LATEST
Thank-you Jim, and the rest of you as well.

I've pretty-well cracked this though.

First, I spent (wasted) a lot of time trying to run InDesign from NAV using Automation. It's 'supposed' to work, but I go up in smoke real fast trying to boot InDesign. MS is looking at it, but won;t guarantee any answer. (Strange, I can boot it through the COM interface package in Tcl/Tk.)

I settled on a new approach, and have a running demo working. I export data from NAV in a CSV file, then generate a VBS script that boots InDesign, opens a given indd file (which I have populated with merge codes), sets the merge datasource, and then performs the merge:

Set inDesign = CreateObject("InDesign.Application.CS3")
Set myDocument = inDesign.Open("c:\Demo\MergeExample1.indd")
Set dataMerge = myDocument.DataMergeProperties
dataMerge.SelectDataSource("c:\Demo\InDesignSampleNavData.txt")
dataMerge.MergeRecords

It works like a charm.

In case anyone is interested, here's the equivalent Tcl/Tk script:

package require tcom
set inDesign [::tcom::ref createobject InDesign.Application.CS3]
after 10000; # To allow all dialogs to settle down
set myDocument [$inDesign Open "c:\\Demo\\MergeExample1.indd"]
set dataMerge [$myDocument DataMergeProperties]
$dataMerge SelectDataSource c:\\Demo\\InDesignSampleNavData.txt
$dataMerge MergeRecords

So, I'm good for now - this will do what the customer wants.

Again, thank-you to all who contributed.

Bob
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines