How to place one row from Excel at a time?


hello everyone,

 

actually topic should "how set excel import preferences?", hesitant change old topic.

 

the problem app.excelimportpreferences doesn't define import preferences. code ignores setting of excel import preferences , uses previous preferences indesign. tried changing table formatting indesign. have tried app.excelimportpreferences.rangename = "a3:h3";.

 

below code. appreciated!

greetings,

bgfrhlp

 

p.s. have tried locate forum , internet, no success.

 

 

doc = app.open(filepath = "d:/base.indt");

newframe = doc.textframes.add({geometricbounds:[6,28,37,84]});

setexcelimportprefs ();

excelfile = new file ("d/file.xlsx");

newframe.place (excelfile);

 

function setexcelimportprefs(){

    with(app.excelimportpreferences){

        alignmentstyle = alignmentstyleoptions.spreadsheet;

        decimalplaces = 4;

        preservegraphics = true;

        //enter range want import "start cell:end cell".

        rangename = "a3:h3";

        sheetindex = 1;

        showhiddencells = false;

        tableformatting = tableformattingoptions.excelformattedtable;

        usetypographersquotes = false;

        viewname = "";

    }

}

 

message edited by: bgfrhlp

one obvious solution problem import information excel file @ once , edit in indesign script.

 

doc = app.open(filepath = "d:/base.indt");

newframe = doc.textframes.add();

excelfile = new file ("d:/file.xlsx");

newframe.place (excelfile);

exceldata = newframe.contents;

arrexceldata = exceldata.split("\t");

etc.

 

p.s. how fire placegun? app.place(); loaded placegun, cannot find way fire script.



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support