Skip to main content
Known Participant
March 27, 2024
Answered

copy the overset table to next textframe in indesign cs6 using visual studio vb.net 2022

  • March 27, 2024
  • 2 replies
  • 997 views

I have a table in one page it is overflows. I want to copy the overset contents to nextframe. Kindly suggest me to copy the overset contents from one frame. Need code for selecting red plus overset symbol in indesing using vb.net 2022

This topic has been closed for replies.
Correct answer Robert at ID-Tasker

Sorry it is not working. It copies the table from start. I need only the remaining columns. If 7 columns is present in table. 3 is in first frame. 4 is within overset.I need remaining 4  only in nextframe.


quote

Sorry it is not working. It copies the table from start. I need only the remaining columns. If 7 columns is present in table. 3 is in first frame. 4 is within overset.I need remaining 4  only in nextframe.


By @Aysha27550661f9sm

 

Are you referring to my code?

 

Yes, in your code:

 

nextparentTextFram = myStory.TextContainers.item(-1).contents

 

you are copying visible part of the last TextContainer - which contains visible part of the Table - which is wrong.

 

My code isn't copying anything - it creates a new TextFrame and let's remaing Rows flow there.

 

You shouldn't use "columns" to describe what is "hidden"/overset - those are still "rows" of the Table - the fact that you've rotated your TextFrame 90 degrees doesn't change Rows to Columns - or vice versa - it only changes orientation and how you see it.

 

 

Try to do "it" in the InDesign manually - click on the "outport" (C) - red "+" - go to the next page (A) and either draw new TextFrame or just click anywhere on that page (B).

Those same steps you need to perform through scripting - but not in exactly same order:

 

(A) Set myNewTF = myNewPage.TextFrames.add

(B) myNewTF.GeometricBounds = Array(0,0,100,100) ' you need to read PageBounds and substract margins

(C) myStory.TextContainers.item(-1).NextTextFrame = myNewTF

 

2 replies

Robert at ID-Tasker
Legend
March 27, 2024

@Aysha27550661f9sm 

 

You need to select text from the last "visible" InsertionPoint of the cell to the end of the parent text of the cell.

 

You need to create a new TextFrame and then use NextTextFrame property of the last TextContainer.

 

Something like that:

 

Set myNewTF = myNewPage.TextFrames.add

myNewTF.GeometricBounds = Array(0,0,100,100) ' you need to read PageBounds and substract margins

myStory.TextContainers.item(-1).NextTextFrame = myNewTF

 

Known Participant
March 28, 2024

Dim iTableCaptionFrame As InDesign.TextFrame = Nothing
iTableCaptionFrame = indesignDocument.TextFrames.Add(, InDesign.idLocationOptions.idAfter, parentTextFram)
iTableCaptionFrame.PlaceXML(iTGrpELm)

iTableCaptionFrame.GeometricBounds = New Object() {8, -30, -8 + tableElm.Height, tableElm.Width - 30}
iTableCaptionFrame.Fit(InDesign.idFitOptions.idFrameToContent)
indesignDocument.Selection = InDesign.idNothingEnum.idNothing
indesignDocument.Select(iTableCaptionFrame)
Dim parenOrigY1 = parentTextFram.GeometricBounds(0)
Dim parenOrigX1 = parentTextFram.GeometricBounds(1)
Dim parenOrigY2 = parentTextFram.GeometricBounds(2)
Dim parenOrigX2 = parentTextFram.GeometricBounds(3)
nextparentTextFram = parentTextFram.NextTextFrame
parentTextFram.Delete()
iTableCaptionFrame.Move(indesignApplication.ActiveDocument.Pages.Item(parentTextFramId + 2))
iTableCaptionFrame.RotationAngle = 90

If iTableCaptionFrame.Overflows = True Then

Dim myStory = iTableCaptionFrame.ParentStory
nextparentTextFram = myStory.TextContainers.item(-1).contents

nextparentTextFram.Move(indesignApplication.ActiveDocument.Pages.Item(parentTextFramId + 3))
nextparentTextFram.RotationAngle = 90

end if 

 

 

i use this code. It is not working. I want  to copy the overset into next frame. and use convert to header for header rows. Kindly help me


iTableCaptionFrame.GeometricBounds = New Object() {parenOrigY2, parenOrigX2, parenOrigY1, parenOrigX1}

Robert at ID-Tasker
Robert at ID-TaskerCorrect answer
Legend
March 30, 2024

Sorry it is not working. It copies the table from start. I need only the remaining columns. If 7 columns is present in table. 3 is in first frame. 4 is within overset.I need remaining 4  only in nextframe.


quote

Sorry it is not working. It copies the table from start. I need only the remaining columns. If 7 columns is present in table. 3 is in first frame. 4 is within overset.I need remaining 4  only in nextframe.


By @Aysha27550661f9sm

 

Are you referring to my code?

 

Yes, in your code:

 

nextparentTextFram = myStory.TextContainers.item(-1).contents

 

you are copying visible part of the last TextContainer - which contains visible part of the Table - which is wrong.

 

My code isn't copying anything - it creates a new TextFrame and let's remaing Rows flow there.

 

You shouldn't use "columns" to describe what is "hidden"/overset - those are still "rows" of the Table - the fact that you've rotated your TextFrame 90 degrees doesn't change Rows to Columns - or vice versa - it only changes orientation and how you see it.

 

 

Try to do "it" in the InDesign manually - click on the "outport" (C) - red "+" - go to the next page (A) and either draw new TextFrame or just click anywhere on that page (B).

Those same steps you need to perform through scripting - but not in exactly same order:

 

(A) Set myNewTF = myNewPage.TextFrames.add

(B) myNewTF.GeometricBounds = Array(0,0,100,100) ' you need to read PageBounds and substract margins

(C) myStory.TextContainers.item(-1).NextTextFrame = myNewTF

 

Community Expert
March 27, 2024

You can't copy the overset part to a new frame. 

Place a new frame and thread it to the overset frame: click the square with the small red cross (the so-called outport), then click on the new frame.

Robert at ID-Tasker
Legend
March 27, 2024
quote

You can't copy the overset part to a new frame. 

Place a new frame and thread it to the overset frame: click the square with the small red cross (the so-called outport), then click on the new frame.


By @Peter Kahrel

 

I'm pretty sure OP wants to split the cell between two pages...