Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Splitting Pages In Word


I'm making packing lists in word based off orders I'm getting in a .csv file. What I want to do is make 1 page per line in the csv file, basically. 1 page per order. I want all orders to show up in the same document, though, as it's easiest for the shippers to print one document and have all the orders show.

I'm using VB6..

My question is, what's the easiest way to tell word to start a new page? Is there a way to jump from wherever you are to the start of the next page? Thanks for any help.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Splitting Word Documents Into Pages
Hello,

I am looking for a way to split word documents into separate documents for each page.
I have been looking for this for a long time, and tried lot's of approaches (splitting by the last sentence occuring on each page, converting to rtf, splitting, and reconverting to word, ...) but they all where very inneficient and due to the large number of files (26000+) I was never sure my result was 100% correct.

Does anyone has a solution for this problem?

Keep Data Report From Splitting Records On Pages
Is there any to keep the datareport object from splitting records at the end of the page?

Splitting Wide Report Into Multiple Pages In Crystal Report 6.0
I have designed a report in Crystal Reports 6.0 which does not fit into an A4 sheet. So I have to split the page into two or more A4 sheets. How can i do that?

Any help or sample report will be greatly appreciated.

Splitting A Word
I am tring to create a hangman-like game..And I need to learn how to split a word and put each letter into
a textbox having an array (t1(x).text) There are ten textboxes on the form each should contain 1 ketter..
and if user can guess the correct letter(s)..those related boxes will be visible else they are all hidden..
Any help would be great... thanks

PHP Code:



Dim dize As Variant
Dim say As Integer
dim sWords() as string
dize = Array("", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday")
sWords=split(dize(rs),"")  
rs = Int(Rnd * UBound(dize)) + 1
For say = 0 To 9
t1(say).Text = sWords
Next 

Splitting A Word
Let's say text1.text = "my user name"

how would i add it to a listbox so it'll look like this:


VB Code:
myusername



here's the code that i was working on, but i get an error:


VB Code:
Label1.Caption = "-1" Do Until InStr(Text1.Text, " ") = FalseLabel1.Caption = Label1.Caption + 1List1.AddItem Split(Text1.Text, " ")(Label1.Caption)Loop


I don't know how to fix this really, and is it possible to not use the label1.caption? is there a better way to do this?

Splitting Word Document By Sections
Hello,
I'm trying to write a Visual Basic script to extract sections from Word document and save them in separate files.
I managed to get sections but I couldn't find a way to write each section into a file.
It seems that all file write operations in VBA accept comma/space separated list and I was trying to write entire section variable.
Can anyone give me a tip on this subject.

Thank you,
Eugene

Word Macro - Splitting Cells
When I do the following line in Visual Basic to interact with Word:

oSel.Cells.Split numRows:=1, NumColumns:=2, MergeBeforeSplit:=False

It behaves differently when I set Word invisible than it does when I set Word visible. When visible it splits the cell where the cursor is at (which is what I want), but when invisible it makes a new column for that row tagged on at the end of the row. Why is this and how can I control it?

Looping Through Pages In Word
Hello

I apologise in advance for my limited knowledge of the Word object, but I was curious to know if there was any way you could make a change to each page of a Word document, pseudocode like this:

Code:
For Each Page in Document.Pages
File.Insert(path_somewhere_else)
DoOtherStuff
Next Page

I saw something about the Range object and my blood ran a little cold But the background is, it's a file that's just been merged and so similar text on each page.

I tried a search and couldn't find it. If anyone knows, or can point me to a link, I would be most grateful. Thanks!

Susan

Fetching Web Pages With VBA (Word)
Thanks everyone for the replies to the original iteration of this question. Sorry I wasn't more specific. Your suggestions worked, but since I didn't specify what application I was working in, they were all Excel solutions, and I'm working in Word. I found a Word solution that works.

My original question was something like is it possible to fetch web pages from within VBA. The details that I left our were: I want to do this in Word, and I want the contents of the web page to be assigned to a variable within my code. The solution I found was simple, but I didn't know it. You can simply Open a web page as a doucument just like you'd open any other doucment. So this works for me in Word:

Sub WebPage()

Dim docNewCopy As Document
Dim strContent As String

Documents.Open FileName:="http://www.yahoo.com" ' , Visible:=False
strContent = ActiveDocument.Content.Text
Debug.Print strContent
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges

End Sub

One problem I'm still having with it however is this: You see on the line of code that opens the Yahoo document the Visible property is set to false at the end, but commented out. I'd like to open it as invisible so that the user doesn't see it and then get the contents and close it as I do in the above code with "ActiveDocument". When I open it as invisible, then I can't use ActiveDocument, so I should use Documents(www.yahoo.com) to reference the object, but while that works for a standard Word document, it doesn't seem to work for me with a web page opened in this manner. When I use what I think the filename should be as an index for the Documents collection, I don't reference anything. Any suggestions?

Barry

Adding Pages To Word Doc From VB
Please can someone help me:-

I've opened the word doc, added all text and pictures , but cannot add another page for the rest of the stuff #%@%#. I've browsed the Object Tree but cannot see anything in the ADD methods, etc.., that references adding a page to the active document ???

Thanks

Number Of Pages In Word
How do you return the total number of pages in a document? Also, how do you automatically insert page numbers? For example, 1 of 5...2 of 5...etc...

Thanks!

Counting Pages In A Word Doc
I have managed to work out how to get a page count from a Word document.

Neil

Working With Pages In Word
I have written a VB program that creates form letters. The data source files are large enough that some of the resulting form files are into the thousands of pages. The data is not similar enough for me to use a Filter in Excel to reduce the source size so I'm looking to work this in Word.

I'm looking for a way to break a Mail Merged document into smaller pieces for submission to a print service. Each job has to be under 1000 pages.

The testing file I'm working with now has 1152 pages. So I need some way for the VB program to make me two smaller files. One file will have 960 pages, the other will have the remaining 192.

How would you make this work?

My current idea is to have the program save the exact same file twice, open the first file and remove pages 961-1152, then save the file. Next it would open the second file and remove pages 1-960 and then save.

Can this be done? Any better ideas?

Thanks!
JT

Word: Total Pages
Hi Friends

I am using Word 2000. I'm trying to get the total number of pages in a document thru VBA. Is there any possibility. The current method I'm following is, I will use the GoToPage available in the Word to navigate the pages from 1,2,3..... till there is no error. Then, the final value is the TotalPagesCount. But, is there any other better way? If anyone knows, please pass it to me.

Thanks
Srik

Editing WORD Pages From Within EXCEL
Hi all,

Could someone please give an example of VBA code for EXCEL in which one can change the orientation of a certain page that’s in a WORD document?

You see, I’m trying to edit a WORD file from within EXCEL, and some pages need to be in Landscape format. Especially those, that have huge Tables on them. I know it should work with range definitions, but somehow things just seem to be 2 complicated.

I know the question’s pretty lame for you guys, but to me it’s quite a problem. Thanks guys.

Best regards,
Andy

Sending To Multiple Pages In Word
I've got an array I'm trying to send to a microsoft word doc. The problem I'm running into is I need the array split, and sent to 3 different pages. How do I select which page the numbers I'm sending are displayed on?

Remove Blank Pages Word
Does anybody know a way to remove all blank pages from a Word document. An empty page is a page that contains only the ---page break -- and the --enter-- charater. Any code-snippet would be great

Adding Pages To Multipage In Word VBA
Please could someone tell me how to add more pages onto a multipage object in design view in VBA for MS Word 2000.

thanks a million

Stuart

Finding # Of Pages In A Word File
I need to find the number of pages in a word file but here is the trick.

I am not opening the file through the open statement.
I am using WORD objects. anyone know of any commands that could be used to make this happen?

thansk

Doug

Deleting Blank Pages Word
Hi everyone
I've a word document and i need to delete the blank pages within it (by vb).
I don't know how to make it through...
Is there any kind of smart method...? Can I loop for each page, and decode if it is blank or no...or something else?
thank in advance for any reply

Number Of Pages In Word Document
I'm working with Word.Application object from VB. I open existing document, do some replacements. One of the fields I need to replace should contain the number of pages of that document. I cannot find appropriate object to work with in order to get the number of pages. I tried this:

set objWord = CreateObject("Word.PageNumbers")
intNumber=objWord.Count



with no success. Object is not created.
Any help would be greatly appreciated
Vlad

Save Certain Pages On Word Template Document
Hello everyone
I have a word template document which I use in VB to create reports. Is there an option by which I can save only certain pages of the document instead of the full template document.Thanks for any forthcoming help.

Add/Delete Pages In Word Through The 10.0 Object Library
Does anyone know if you are able to add and remove pages from your Word document using VB code? I know how to create and manipulate the document, but I am unsure whether you can add to and from a document. I am working on a automation project where the user can enter various criteria through a html form and based on that criteria certain pages are assembled into one Word document.

Counting No. Bullets And Pages In A Word Document
Hi there. Can anyone please tell me how to use vba in word document to find a value of no. of bullets and pages used in a word document?

Thanks.

Aligning Textboxes On Word Pages With Footnotes
Sorry if this is not the appropriate forum for this type of question.

I regularly create MS Word documents including charts and tables in text boxes. In order to ensure consistency of appearance I use code to position these boxes aligned with the bottom margin of the text. This works fine except on pages with footnotes, where the body of the text finishes higher on the page than normal. On such pages using:

Selection.ShapeRange.RelativeVerticalPosition = wdRelativeVerticalPositionMargin
Selection.ShapeRange.Top = wdShapeBottom

Places the textbox over the footnote text, not immediately above it, as I would like.

My query is whether there is a way to use code to determine where the bottom line of body text is on a page with footnotes, so I can automate placement of boxes aligned with the bottom margin of body text on these pages too.

I’m using Visual Basic 6.0

Question On Printing And Word Style Pages
Hi. I'm trying to make a project that does a few things.

1) access a database (done)
2) get info from database (done)
3) arrange info into a page for preview (not done)
4) print if everthing is ok

I have a word document as a template and only a few things have to be changed, which is the info from the database to be put in specific places. I don't necessarily need to use word, but any way that I can get it to print with similiar results.

Any help would be appreciated

Thanks

Save Certain Pages On Word Template Document
Hello everyone
I have a word template document which I use in VB to create reports. Is there an option by which I can save only certain pages of the document instead of the full template document.Thanks for any forthcoming help.

Save Certain Pages On Word Template Document
Hello everyone
I have a word template document which I use in VB to create reports. Is there an option by which I can save only certain pages of the document instead of the full template document.Thanks for any forthcoming help.

MS Word 2000 VBA - Delete Blank Pages
Hi! I'm having trouble trying to create a macro in MS Word 2000 VBA. I am trying to write some code to cycle through an entire document and delete any page that is blank. There are no empty paragraphs on these blank pages, just basically a ton of extra blank pages.
Thanks for any help!

Printing Specific Ranges Of Pages In Word 2000
I have a 60,000 page Word 2000 document. There are 7,500 people who need four double sided pages printed front and back and then stapled.
What I want to do is send the file to my copier and have the pages individually printed and stapled for each of the 7,500 people. What I would like to do is create a macro that will send the first 8 pages and then the next 8 pages and so on. I have to do it this way because I can not send the entire document and have the copier staple each 8 pages by themselves, it would try to staple the whole document, which obviously wouldn't be possible nor is it what I want. Is there a way to do this in a Macro, such as using WdPrintFromTo? Or similar?
Thanks.
Jim

Rows Break Across Pages In Word Table Problem...
Hi, all
I used VB6.0 and office 2000 to generate a table as shown in the attachment.

The table was created row by row(except the first two rows). The problem is that when I try to attach a new row and the height of the row is more than one page, the new row will skip to the next page rather than continue from the current page.

I try to solve this problem by using commands like:

oDocument.tables(1).Rows.AllowBreakAcrossPages = False

but seems that it will never affect the output table.

Any idea on this.

Thanks in advance.

Sami

Full Word Indexing Html Pages And Searching
hi
im having trouble figuring out how to do this, i have a visual basic program that has a search function in it and i want it to search html pages based on what page the user selects to search for certain text also i want it to be able to search a index of all the html pages in the case that the user doesnt select a certain page. im having trouble with this for 1 i dont know a whole lot about visual basic yet, 2 i dont know how to index html pages into one big index and also i dont know how to make it search just one html page for certain words. any ideas or help on this would be very helpfull. sorry for the non-puncuated sentences by the way =)

Rows Break Across Pages In Word Table Problem...
Hi, all
I used VB6.0 and office 2000 to generate a table as shown in the attachment.

The table was created row by row(except the first two rows). The problem is that when I try to attach a new row and the height of the row is more than one page, the new row will skip to the next page rather than continue from the current page.

I try to solve this problem by using commands like:

oDocument.tables(1).Rows.AllowBreakAcrossPages = False

but seems that it will never affect the output table.

Any idea on this?

Thanks in advance.

Sami

Help With Splitting
I'm splitting a line that looks like this:

Code:
firstpart;secondpart;thirdpart
I can split them fine, but how do I view the first part against the second, etc?

The array variable is sArr() and when I do:

Code:
Debug.Print sArr(i)

It will print fine in the debug mode. I tried to do sArr(i,0), but it said subscript out of range.

My goal is to add to a listbox "firstpart;secondpart" and get rid of the thirdpart...but I can't figure out how to add it. Here's my code:


Code:
Dim sData As String
Dim sArr() As String
Dim hFile As Integer
Dim i As Long
Dim Homes
Dim s As String, w As Variant


'Set the global File name and path.
HomesText= App.Path & "homes.txt"
'Check if file exists.
If LenB(Dir$(HomesText)) Then
'Get the data.
hFile = FreeFile()
Open MySpaceText For Input As hFile
sData = input$(LOF(hFile), hFile)
Close hFile

'Move the data into the listbox.
sArr() = Split(sData, vbNewLine)
For i = 0 To UBound(sArr())
Debug.Print sArr(i)
sArr() = Split(sArr(i), ";", 2)
Debug.Print sArr(i)
List2.Clear
If sArr(i) <> "" Or Not sArr(i) <> vbNewLine Then Me.List2.AddItem sArr(i)
Next i

Splitting
Hellow i am new to this forum and a "beginning" coder, i had some basics on my school but anyway ...

this is my problem:
I want to split a string of characters when the symbol "%" is founded in that string. So i have the word before the "%" and the word after the "%".

For example: i have the string "extreme%vbtalk"
no i want to have funtion that splits that string into 2 ceperated strings

string1 ="extreme"
and
string2 ="vbtalk"

You see what i mean. Could somebody help me with my code or even make one for me. I don't know where to start so i thought you guy's will know how it works

Splitting
Hi! In vbscript there is a function called split where you can slipt a string in an array. I need to do the same in VBasic (5) and I dont know if there is a function like that. Can that be done without looping thru the string using mid$?
Tnx!!!

Splitting
i've got an array, it CAN be devided in more than 2 pieces.
So array(0), array(1), array(2) etc.
But I only want array 1 and up, so without array(0).
The amount of arrays varies every time.

Splitting
Lets say I have a textbox, with the multiline property set to true. Within this textbox I have:

A = TRUE
B = FALSE
C = TRUE
D = TRUE

.. But of course these true and false statements can change. The a b c and d statements will not change. My question is, how do I split this up? How do I arrive in VB with like:

If C = True Then ....

or If A = False then...

I realize I must split each thing up, but I'm not sure how to. I would like to assign each their boolean. So after running the program, I would like VB to actual know if A B C and D are either true or false. So I could Get:

Dim A, B, C, D as String
..Splitting stuff....
a = information i split (True or false)
b = information i split (True or false)
c = information i split (True or false)
d = information i split (True or false)

^^basically.

How would I do this? Thanks.

Splitting.
Ok i know how to split but is there a way to get say
j(2)-however many other entrys there are.
then send all that info to a client and then it determines how many there are and adds it to a listbox?

Splitting My App !?help?!
Ok I have posted about this before... but now it seems inevidable that I need to split up my application (which essentially is a bunch of smaller data collection database applications) that is used by various different departments in my building. I really am not sure what route to take since right now there are a bunch of modules that have common code and things like that... but it needs to be seperate apps because that will make it a ton easier to modify and maintain since if I have to change one app right now. I need to get everyone out of the application and then recompile over the old file.. So what should I do? build dlls to hold all the shared functions? I don't want to go through the whole registering dlls bit unless I have to since this will be a networkes install on a ton of PCs.

Splitting
I want to split a few things
For example:
part1 "part.2" part.3" :part4

And then store it in variables. How can i do this?

Splitting
Alright, I have 3 lines of text, and I need to seperate them. I know that you can use the split function, but I have no idea on how to do it. Here's an example of the text which needs to be split:

Programz 132
File82
NoNameFile

I need to split them so that I can add them individually into a listview. There also may be more than 3. Anywho, please help me out. Ty

Splitting A PDF
I need to be split a pdf file that is 100+ pages long into seperate pdf files that contain 2 pages. Basically I'd like to loop through the 100+ page pdf and ever two pages, create a separate pdf containing those two pages etc etc.


Hilbertl

Splitting Again
Sorry about the repeated problem but I still cannot get my text file to split the way I want it to, believe me I have tried everything (well almost everything).

What I want to do is split a text file on the VbCrLf into an array, then take each array and split it a second time with a different delimiter. My problem is not knowing enough about variable types, ie.. variants, strings, ect..

this is what I have, it is close...I think


Code:

Shell "cmd /c netstat -a > c: ext.txt", vbHide

Dim Str As String
Dim str2 As String
Dim parse As Variant
Dim parseagain$()
Dim x As Variant
Dim y As Variant

List1.Clear
List2.Clear
Open "c: ext.txt" For Input As #1
Str = Input(LOF(1), #1)
Close #1
parse = Split(Str, vbCrLf) 'this delimiter breaks up the file nice

For Each x In parse
List1.AddItem (x) 'this part is working fine

For Each y In parse(x) 'this is the part I'm not getting
parseagain = Split(parse(x), " ")

List2.AddItem parse(y) 'Im trying to split the first array again and add it to another list box
Next

Next

TXT Splitting
Anyone who know how to split this string? I will split it and insert double
quotation mark between letter no 9, 12 , 15 and so on....
Here is the string: 890220010123001ATS00001000000006001002001012311380800

Any syntax suggestions?

File Splitting
I plan on making a program that will split files into smaller sizes...

I really don't have much File I/O experiance.., all I have done so far is read Gavin0's File I/O tutorial...

I don't have any Idea where to start..

Any responses will be appreciated

thanx in advanced,
Byan

Splitting A Textfile
Hi
I´m new to this board and new to VB.
I have opened a textfile with many lines containing numbers, the lines starts with 300, 305, 335, 360 and so on. The textfile is in a listbox and is sorted.
My question is this, can i somehow take the lines starting with 300 and save them to a textfile, and then take the lines starting with 305 and save them and so on. Is there an easy way to do this?

Jesseume

Splitting Up An Image
I have a number of bitmap images, all 128 pixels high and an integer number of 128 pixels wide (ie 1024 x 128, 640 x 128 etc.) and I want to chop these images up into a number of 128 x 128 images and put them into an imagelist for use later what is the best way to do this?

Also, I want to later superimpose a number of images which are saved in an imagelist into a picturebox or image control. I can use the imagelist.overlay to do this with 2 images, but what about 7 images? (i gather the overlay command only does 2 images)

Thanks for the help.

Splitting Files
Hello,

I am interested in making a splitting program (splits big files into smaller chunks and you can re connect the chunks later). Does anyone know where to start? (Easy tutorials. basic guidelines?)

Thank you very much, Id really appreciate it.

l8ers

Copyright © 2005-08 www.BigResource.com, All rights reserved