I am exporting/pasting data from excel to word. Now i need to inset pagebreak so that the next para come on a new page. However nothing seems to be working. Please help.
Current code portion:
Please Login or Register to view this content.
I am exporting/pasting data from excel to word. Now i need to inset pagebreak so that the next para come on a new page. However nothing seems to be working. Please help.
Current code portion:
Please Login or Register to view this content.
Last edited by arian29; 06-30-2015 at 07:50 AM.
Where's the code you tried for inserting a page break?
I would have expected to see something that used the InsertBreak method.
If posting code please use code tags, see here.
I tried using - myDoc.Paragraphs(1).Range.Find.Execute findtext:="TABLE 1: SCOPE OF SUPPLY"
But it didnt work. I was getting a pagebreak but on top of the pasted para and not after it.
So i found this page - https://msdn.microsoft.com/en-us/lib...ffice.11).aspx
Complete code i am working on ::
Please Login or Register to view this content.
Help!............................
bump!...............................
Can you upload a sample workbook?
Also, can you explain exactly where you want page breaks?
Need the pagebreak after a table is pasted.
If you see.. code pastes table 4 then 3 then 2 then 1 so 1 come on page 1 then followed by rest of the tables. So i need table1 pasted then a pagebreak so that table 2 is pasted on the next page.
I was trying to control the cursor or use methods to search specific strings in the file and put a page break there ' all commented items'.. wasn't successful though
Last edited by arian29; 07-02-2015 at 08:28 AM.
Why are you pasting in that order if that's not the order you want the tables to appear in the Word document?
If i paste in the order, 1 2 3 4 it is pasted incorrectly. It pastes then pushes the old table down so table 1 will end up at the last page instead of the first.
It should be straightforward to paste table1, insert a page break, then paste table2 after the page break, insert another page break, insert table3 after the page break etc.
You should just need to change this so that it pastes at the end of the document instead of the start.
Please Login or Register to view this content.
Change to what ? I am stuck.. Nothing seems to work..
Any chance you could upload a sample workbook?
Click on GO ADVANCED and use the paperclip icon to open the upload window.
Won't be possible to upload all.. as data is critical..
Don't need real data.
It wont be possible. Its a big dashboard with lots of data and modules. This is just the part where we print. i remove any data or module it gives a random error. N i dont wanna create errors n debug them for this.. hope you understand.
You can't just mock up an Excel workbook with some sample, dummy data?
Hi, Ok i have attached the file. All codes are deleted and data removed/changes. To test please go to Sheet3 (Table2) and press the Test button. If the sheets are hidden you would have to unhide them manually.
Hello.. anything.. ?
arian29
No.
bump!............................
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks