Over 1 million tech questions and answers.

Word 2007: Split large document into individual files based on text string

Q: Word 2007: Split large document into individual files based on text string

Hello all,
I am fairly new to macros and am looking to split a large word document into smaller files based on a text string within the document, and then save those files as individual word documents, or as a bonus, PDF documents. The text string is "HEADER DATA".

Basically, I want the macro to find the text string "HEADER DATA", then select that page and all pages up to but not including the next instance of "HEADER DATA", then cut those pages from the original document, create a new document with the same formatting/ page layout, and save that document with a new file name. I want the process repeated until the end of the document, and each file saved with a new file name.

Some attributes about the file:

The text string "HEADER DATA" is always in the same location on a page, but is not at the top of the page.
The format and layout of the new document must match the current document.

Here is something I came up with (don't laugh too hard, lol). This will extract the first pages as intended, and saves the new file, but then Word stops responding. I don't quite know what the error is. Thank you in advance for any help.

' SPLIT Macro
vPath = ActiveDocument.Path & "\"

With Selection.Find
.Forward = True
.Wrap = wdFindContinue
vFirstRecord = True
i = 1
End With
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveUp Unit:=wdLine, Count:=22
Selection.MoveUp Unit:=wdScreen, Count:=5, Extend:=wdExtend
Documents.Add Template:="Normal", NewTemplate:=False, DocumentType:=0
Selection.Font.Name = "Courier New"
Selection.Font.Size = 9
WordBasic.TogglePortrait Tab:=3, PaperSize:=0, TopMargin:="1", _
BottomMargin:="1", LeftMargin:="1", RightMargin:="1", Gutter:="0", _
PageWidth:="11", PageHeight:="8.5", Orientation:=1, FirstPage:=0, _
OtherPages:=0, VertAlign:=0, ApplyPropsTo:=0, FacingPages:=0, _
HeaderDistance:="0.5", FooterDistance:="0.5", SectionStart:=2, _
OddAndEvenPages:=0, DifferentFirstPage:=0, Endnotes:=0, LineNum:=0, _
StartingNum:=1, FromText:=wdAutoPosition, CountBy:=0, NumMode:=0, _
TwoOnOne:=0, GutterPosition:=0, LayoutMode:=0, CharsLine:=39, LinesPage:= _
36, CharPitch:=240, LinePitch:=360, DocFontName:="Times New Roman", _
DocFontSize:=12, PageColumns:=1, TextFlow:=0, FirstPageOnLeft:=0, _
SectionType:=1, FolioPrint:=0, ReverseFolio:=0, FolioPages:=1
With Selection.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientLandscape
.TopMargin = InchesToPoints(0)
.BottomMargin = InchesToPoints(0)
.LeftMargin = InchesToPoints(0.5)
.RightMargin = InchesToPoints(0.5)
.Gutter = InchesToPoints(0)
.HeaderDistance = InchesToPoints(0.5)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(11)
.PageHeight = InchesToPoints(8.5)
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
.BookFoldPrinting = False
.BookFoldRevPrinting = False
.BookFoldPrintingSheets = 1
.GutterPos = wdGutterPosLeft
End With
Selection.PasteAndFormat (wdFormatSurroundingFormattingWithEmphasis)
ActiveDocument.SaveAs (vPath & vFrom & "_" & i & ".docx")
i = i + 1
vFirstRecord = True
End Sub

I've done a bit of searching on this subject, and came up with a thread on this forum from a few years ago where someone made a similar request, but that person also needed to replace the "@" symbol throughout the file with a "_", which added some lines in the code that are making this noob even more confused. He/ She wanted to split documents based on email addresses. Here is a link to that somewhat relevant thread:

Again, any help is greatly appreciated. Thank you.

Read other answers
Preferred Solution: Word 2007: Split large document into individual files based on text string

I recommend downloading and running Outlook PST Repair. It's a PST repair tool that I've used it in the past to recover emails, contacts, tasks and notes from corrupt Outlook files that are damaged or inaccessible. Supports Outlook 2000, 2002, 2003, 2007, 2010 and 2013.

You can download it direct from this link http://goo.gl/1bjhSi. (This link will automatically start a download of Outlook PST Repair that you can save to your computer.)



I am having an issue with word wrap in outlook 2007. I always want to send email as text at 76 word wrap. I tried several number of wraps 72, 74, 76 and 80 but all the same. below is my sample email with messed up word wrap.

> Yes, your email will still go through if the mail server doesn't
> support
> SPF. It only provides the extra benefit if the server does support it,
> but nothing bad happens if the server doesn't have SPF. You will still
> be
> able to send and receive email without a problem.

Is there any fixes for this?
Please help! Thanks!

A:Text Based Word Wrap in Outlook 2007 messed up

Read other 10 answers

I have a list of all my MP3's in a text file. I want to delete everything on the line except for Artist - Song Name.mp3.

For example:
Green Day - Armatage Shanks.mp3 ::INFO:: 2.68Mb 2m17s 160/44.10/JS

I want to delete everything starting at ::INFO::

A:Need a text editor/program that can delete part of a line of text based on a string

I figured it out. I had to learn about regular expressions in text editors.

Read other 1 answers

So I am officially desperate! I worked on a project in Microsoft Word 2007. I then went to go open it the next day and all of the text was completely gone!! I am only a beginner when it comes to computers so I have absolutely no idea what happened.
To better understand the problem here were the chain of events:
I worked on 2 documents, saved them in a folder, and then closed MSWord
I then worked on them the next day not realizing that for some reason they were opened as "Read Only"
Seeing that, I copied the the text and saved them in new documents
I went to Documents and attempted to move the new documents into the folder with the originals but an error message reading something like "this action cannot be completed because the file is open in another program" when the file was NOT open
In my frustration I attempted to move it over and over again to no avail
I gave up and closed the Documents folder and turned off my computer
The very next day I went to open the project and both the original documents and the copied ones were COMPLETELY EMPTY!!!
the files were still there but the all of text was completely gone!
Through Microsoft forums I've repeatedly tried the "Recover Text from any File" and "Open and Repair" methods
They've remained completely empty
I don't think I can redo the project correctly in the time it is due! Please any info will help. Thanks

Also, if this helps- I tried to save another Document and MSW says... Read more

A:Please Help! Lost text in Microsoft Word 2007 document

Read other 9 answers

I need to have editable text, preferably as WORD .doc to create files to be sent to another person. Is there some sort of conversion process for some wordpad text I now have?

A:Solved: converting text files in Win XP from wordpad to a WORD document

Simply open them in Word and save them as Word files. Nearly everyone can open WordPad files though.

Read other 1 answers

Hi! I've been looking for a piece of VB code that can accomplish this. The pasted data below is from an EDI text file. The first few lines that start with SA* and end with *004010~ is the header and is unimportant. I would like to extract the 2 groups of data that start with ST* and end with the line that begins with IEA*. In other words create 2 new text files from this one. In other files, there may be instances where there are 3 or more groups of data in the .txt documents so I would like to avoid any code that splits based on a line count. I can read and alter VB better than I can create it so my efforts to code this on my own hasn't worked. Any help with this would be greatly appreaciated!

SA*00* *00* *02*CSAC *12*6153774400 *081126*1833*U*00401*000021367*0*P*^~
N3*825 BLUFF RD~

A:Split a text file based on groups of data

Read other 6 answers

In Unix there is a "dd" command that will enable the user to split up a large text file into smaller segments. I am on XP and have a 600Mb text file and I want to chop it up in two pieces so I can read it more easily. How can I do this, preferrably from a command line??

A:Solved: Large Text File to Split Up

Read other 13 answers

Two people use my computer, Nathan and Michael. Both are Administrators. When Nathan is logged on his Word 2003 documents are saved in: C:\...Nathan\Documents.

When Michael is logged on, his Word 2003 documents are also saved in: C:\Nathan\Documents.

Obviously, the way it should work is Nathan's Word documents should be saved under his log-in and Michael's documents should be saved under Michael's log-in. I can't make that happen. Here's what I've tried so far:

I go to Control Panel, Tools, Options, File Locations.

When I click Modify I can indicate a different folder for saving Word documents, but I can't change the location "Nathan." Also, any change I make just adds the new extension to the existing. Example:

C..\Nathan\Documents Modified to: C..\Nathan\Documents\Documents

just an example. Whatever I choose is added onto the existing location


I hope I've explained this clearly. Any Word 2003 experts out there who can help on this one? It's really got me puzzled. Thanks in advance.

A:Can't set document location for individual users in word 2003

Michael does not have his own login, Like you and the other user have. You can confirm this by going to C:\Users. Is there a Michael user? If not, Go to Start/Control Panel/User Accounts and create a new user profile for Michael. This will create a new Documents folder under Michael's user name. Log out of your user profile and log in as Michael. Open Word up go to Tools/Options/File Locations. Make sure the default Save location is C:\Users\Michael\Documents. Michael can set his own password for his login.

Read other 2 answers

Hi all,
This is just a preliminary request for advice before I undertake writing a fairly substantial VBA macro.

My plan, in short, is as follows:

- User receives a daily Invoice file. The data from this is to be dropped onto an Excel Table I've prepared (let's call this the Invoiced Table) in the Master File, which will allow some formulae, such as IFs and Vlookups to static tables, to auto-populate. Each day's data is to be appended to the bottom of the table.

- User receives a weekly Paid file. The data from this will be dropped into a second Excel Table (let's call this the Paid Table) on another worksheet in the Master File.

- Once the weekly file data has been dropped in, the user will run the macro. This will compare records from the Invoiced Table against the Paid Table using at least 4 (probably 8) different sets of lookups. In a simplified example, these might be 4 different customers.

- Each set of lookups will result in some matches. For each matching record for a specific customer, fields from the Invoiced and Paid tables need to be combined into a new record on a seperate worksheet.
So in a simplified example, Record 1 might have an Invoice Number in the Invoice Table that matches the Invoice Number in the Paid Table. I'll need to copy the Invoice Number, Customer Number and, say, the Invoice Date field from the Invoiced Table, plus the Paid Date from the Paid Table.

- I'll then need the macro to delete those lines from both t... Read more

A:MS Excel 2007 - VBA Macro to split large file

Is excel the only option? Access would do a lot of this without the having to write a macro every step.

Read other 2 answers

I have a project where I need to search a large amount of text files on my home PC. I recently upgraded from Windows XP to Windows 7. My research indicated this feature was available in Windows 7.

If you do a search in Windows XP, you get a bunch of fields. You can pick to search for text INSIDE the particular sub folder structure.

I have found this feature in Windows 7, but it is different. I have tried using wild cards but it does not seem to work properly.

Thanks for any advice, if you need further assistance, I could make a video to show the issue.

A:Searching a bunch of text files for a particular text string

I don't have Windows 7. So I can't comment on how effective the search feature is. But I know I would not be able to function without the tool Agent Ransack.

It's a free utility, see if it will work for your needs: http://www.softpedia.com/reviews/windows/Agent-Ransack-Review-60432.shtml

Read other 10 answers

Normally when I want to copy text from a .pdf, I simply place my cursor at the starting point and drag it down until it covers all the text I want to copy and page. It is a slow process but for a small amount of text it is not a burden. But if I need to copy a large amount of text (pages) it can be slow going. Is there some way I can speed up the process?

A:Copying large amounts of text in .pdf document

Read other 7 answers

When saving a Word 2007 document as a webpage (htm, html), an extra folder is automatically created besides the hmtl document itself. This folder contains background information like pictures, wallpaper etc. Is there a way to prevent that folder from being created in the first place? I've got Word 2000 on another computer, and when I save my word documents as html files over there, that extra folder is not generated. The only time that folder is created in 2000 is if my documents contain pictures, wallpaper etc. In Word 2007, it is created all the time, even though my documents are just plain text.

A:Solved: Word 2007, saving document as html document: how to get rid of extra folder?

Managed to find the solution, it was very simple after all. One has to save the document as a filtered webpage and click "yes" when a box pops up warning you that you will use certain featuers which are specific to Office2007, such as the background. Then the document will save without that extra folder and files.

Read other 1 answers

I have two questions regarding documents created in Word 2007...

1) Can links be created within a Word document? For example, can I click on and item my table of contents and have the document jump to that particular section of the document?

2) Also, is there a way to make sections of the document hidden until the user clicks a specific word or graphic in the document?

I'd like to specify a particular instruction and include a "Show example" link that would make a detailed example appear for those who needed the extra help.

Thanks everyone!

A:Word 2007 - Links within a document? Hide/Show sections of a document?

If you created table of contents through References - Table of Contents, you can hold Ctrl and click on the item in that table, word will take you there. This feature is standard.

Also, to navigate inside document you can use bookmark option.
Insert bookmarks. Word 2010 Bookmarks
Then insert Hyperlink - in the window select second tab "Place in This Document" and choose your bookmark.

As for hiding parts of document, I do not think that is possible.
You can create that in HTML document with javascript, but not in Word document.

Read other 3 answers

Hi there!

I've got a word document that I need to split into new documents. Each page has a specific value on it that I could use to copy the pages that have this value on them into a new workbook. i.e. the first 5 pages of the workbook might have the value 2468 on it. the next 3 pages might have the value 3579 on them, the subsequent 8 pages might have the value 6789 on them.

Can anyone show me how to do this in VBA? I was thinking that I could maybe:

1) find the last page that the values appear on
2) add a page break
3) copy the pages of the book into new documents based on locations of page breaks I've added.

But I don't know how to do that, especially the bits with question marks...

Can anyone help me out?

Public Sub CreatePageBreaks_and SplitDoc()

Dim Mydoc As Document, NewDoc As Document
Set MyDoc = Word.Documents("C:\myfolder\mydoc.doc")
Selection.HomeKey Unit:=wdStory

MyConst = 2468

'get page that value last appears on
Dim y1 As Integer
Dim r1 As Word.Range
Set r1 = MyDoc.Content
If r1.Find.Execute(FindText:=MyConst, Forward:=False, Wrap:=False) = True Then
y1 = r1.Information(wdActiveEndPageNumber)
End If

'create page breaks based on page that last value is on?????

NewDocName = "c:\myfolder\mydoc_ " & MyConst

'copy pages up until/between page break and copy into a new doc?????

NewDoc.SaveAs filename:=NewDocName
MyDoc.Close wdDoNotSaveChanges

End Sub

A:How to split a Word document into multiple documents?

Read other 11 answers

Greetings! I've searched everywhere for the answer to this issue. It must be common, but I can't find it anywhere. I'm using MS Word 2007, but the problem was the same in 2003. I sometimes get a text box that is behind regular text. I need to move it. One normally just selects a text box and drags, or cut and paste, it where one wants. However, when it is behind text, it can't be selected. I have found no way to select normal text and "send it behind."

How do I get to this text box that is behind my regular text? I've been told to "move the regular text out of the way, then you will be able to get to your text box." But the text box moves with text!



A:Text box stuck behind regular text in MS Word 2003 and 2007, Can't select text box.

You can't post a link to your computer to post an image. We cannot access your computer. Upload the png image as an attachment please. To do that, scroll down to "Manage Attachments" then click on "Browse" to locate the file on your computer then "open" it and then click on "Upload" and submit your reply.

Read other 1 answers


I have a 300+page Word 07 document which is A-4 page size. I need to insert drawings that are A-3 that will need to remain full size for later searcheable pdf development for web posting. The A-3 will be folded to A-4 size for the printed copy.

I see how to change section page sizes, but A-3 or 11 x 17 are not available.

Any ideas?

A:Large document Word o7

Read other 11 answers

I recently installed Office 2007 on a new Vista 64 bit system. I was unable to install my previous version of WordPerfect Office 12. When using WP on my previous Windows XP system, I was able to go into the word processor, click open, go to the wp folder (where I kept all my documents) and do a search based on a particular word I was looking for. For example, I could type in the word "hebrew" in the files box and each document file that contained that word (not only in the file name but in the contents of the file) was listed. I could then preview the contents of each document file and open the one I wanted.

Does this feature work in Word 2007 under Vista 64? I have only been able to find a file name with the word I type, even though I know many other document files contain the word I type in the files box. This has been very frustrating because it means I have to preview every file to find the one I want rather than just the files with the typed word in its contents.

Thank you for your time in this matter.

A:View limited file content based on key word; wordperfect and now word 2007

Hello Mert55,
Have you checked the Word Online "help & how to"? [ Word - blue question mark top right hand corner - click ]

Links below should provide help & address your problem.
Let us know the result.


Microsoft Word 2007 Tutorial—Free & Online

Read other 6 answers

I want to split my large .pst file into smaller parts and looking for reliable way to do same as I don't want to loose any single email during the splitting process.

I am using Outlook 2007 and want to split PST file by year.

How can I do that?

Please suggest accurate way ASAP...

A:Solved: How to Split Large Outlook PST Files??

Read other 6 answers

Hi I have a large chm file of size 150MB and I have extracted the file into a folder using 7zip and the resulted folder size was 420MB and it contains 40000 HTML and other files. I have tried to convert the chm file into pdf file using atop chm to pdf converter and the resulted pdf file size was 250MB.

The chm file consists of bookmarks and again each bookmark consists of bookmarks.

Can you suggest how to extract the contents of a bookmark in chm file to another chm file or pdf file.

Read other answers

As above.

Is there a software upgrade i need to do.

I have the password. comes up with...

"Word experienced an error while trying to open this file"

Thanks in advance


A:Solved: Can't open password protected Word 2007 document in Word 2003

Read other 6 answers

I've email printout with e-mail subject,sent out by the user who left our employ. His account was deleted and cannot be recovered. The user have left whole lot of PST files and we are hoping that he had saved this "sent" e-mail in one of them. The PST files are rather large and contain tons of folders each, so it's kinda hard to go through each one finding this very specific Subject line. Is there any other way to scan within the PST files to find a particular text string, like this Subject line? Before I start googling this stuff, I thought someone might already been there/done that.

A:How does way to scan within the PST files to find a particular text string?

Open the PST files in Outlook and do a search.

http://office.microsoft.com/en-ca/outlook-help/open-a-data-file-HP005243221.aspx or http://office.microsoft.com/en-ca/outlook-help/open-outlook-data-files-pst-HA102749406.aspx

And: http://email.about.com/od/Outlook.com-Tips/qt/How-to-Search-Mail-in-Outlook-com.htm

Read other 1 answers

For an easy solution, for the past three days I have been searching for the best way to split the large size of PST file into small size PST. If you can help me please share your thoughts with me.

Read other answers

Ok this is wierd I have a client using Office 2007 pro and some of her docs that she recently updated and the problem is when she prints the docs text that she deleted is printing over the top of new text she inserted into the doc.

Now when you have said doc open in WORD the deleted text is not there in any view and does NOT show in "print preview".

I opened said doc with WORDPAD and the deleted text shows up at the bottom so its still in the word doc somewhere imbedded so it prints over the top of the actual text in the doc.

Any thoughts this has me baffled.

A:Office 2007 Word printing deleted text over new text

First thought which comes to mind is, has your client pressed "hide" instead of "Delete"...

Remove hidden data and personal information from Office documents - Excel - Microsoft Office

How do I find and remove hidden data and personal information in my Office documents?

You can use the Document Inspector to find and remove hidden data and personal information in Office documents that were created in Office Word 2007, Office Excel 2007, Office PowerPoint 2007, and earlier versions of these Office programs. It is a good idea to use the Document Inspector before you share an electronic copy of your Office document, such as in an e-mail attachment.
Open the Office document that you want to inspect for hidden data or personal information.
Click the Microsoft Office Button, click Save As, and then type a name in the File name box to save a copy of your original document.
Important It is a good idea to use the Document Inspector on a copy of your original document because it is not always possible to restore the data that the Document Inspector removes.
In the copy of your original document, click the Microsoft Office Button, point to Prepare, and then click Inspect Document.
In the Document Inspector dialog box, select the check boxes to choose the types of hidden content that you want to be inspected. For more information about the individual Inspectors, see What information can the Document Inspector find and re... Read more

Read other 3 answers

Is there any kind of tool can split single or multiple PST file on the basis of different criteria, like Date, Size, Mail ID, Folders & Time.?

Read other answers

I have what I hope to be a relatively simple question..

If I have a drop-down box in word, how can i get it to spit out a line of text depending on what I have selected in the list?

Read other answers

Hi guys, this may seem a simple question on how to copy and paste but is giving me a huge headache.
I am trying to copy the script (text) only of an email received in hotmail in to Microsoft Word to create a document which I can then post as a letter.
When I select and copy all is fine, but when I try to past it in to Word, Windows stops the program saying a problem has been found.
What can I do? Are there alternatives? Am I doing something wrong?
I am running Windows Vista home basic.

A:hotmail text to word document

Hello and welcome to TSF,

depends on the word version you have just paste the text as unformatted text
in word 2003 and older: Edit -> Paste special -> unformatted text
Word 2007 and above: click on the arrow under the paste button (under the office button) and choose paste special

Read other 1 answers

Hi to all.
Christiane has the situation where every new document she opens has the same three lines of text appearing. She deletes them and types her ducument and saves it ok. Next blank document she opens - the three lines of text re-appear.
How do I reset her blank document to be blank?

A:MS Word 2000 same text every document

1. could be loading a template
2. could be a virus

check both

Read other 3 answers

hi, im a windows 2000 home XP user
i created a word file writing an important paper, and mistakenly deleted most of the text a few days ago.
is there ANY way that i can recover text i deleted? i have the file saved after deleted the important part.
i dont have any saved versions...
hope someone can HELP or ill have to do it all over again..
thanks in advance!

A:undeleting text in a word document

I am afraid you are sol unless you had track changes on.

Read other 1 answers

The text in my documents is in a fairly narrow column, instead of spread wide to the edges of the program screen. Things were find on another computer, but when I moved to a new PC and started loading up documents they were narrower.

Note 1: The documents print fine. It's only their appearance on the screen that's narrow.

Note 2: Nothing in the 'page setup' options area has helped.


A:Word 97: Document text is not spread out like it used to be

any thing in view
have you got web layout or print layout ??
is it set to normal

Read other 2 answers

This problem has actually been observed in previous versions of Word, but when a user splits their screen, makes edits to the top half of the split screen, then removes the split, Word tends to refocus or "shift" the view of the document about a half page downward on the screen. Is there any way to prevent Word from doing this auto-refocus when removing the split screen feature?

Read other answers

Hello all,

On the 12th October I was editing a Word 2007 document on my Vista Home laptop. Throughout editing I pressed Ctrl S to save the doc over the previous version. I copied data in from several other files.
I went back yesterday to edit the document again and it has disappeared. The only version of the doc is a previous version dated 21st Sept.
I searched on all files modified after 11th Oct just in case I had saved it under another name. Not in there. The files I copied data from did come up in the search results though, soi knwo the search function is working.
I checked the default Autosave location - not in there.
I checked the recycle bin - the doc is not in there and neither are any ~ files or autosaved files. I haven't emptied my recycle bin for months.
I cannot find a word doc modified afetr the 11th October.

Can it really just have disappeared? It is my MBA dissertation paper and I worked on this edit for an awful lot of hours.

Many thanks.

A:Word document disappeared: Word 2007

Welcome Suzanne

I am a lot older than you, but I still remember those term papers and finals. I will dow everything that I can to help

Start with this
DiskDigger | The trusted data recovery solution

Read other 1 answers

Any program that can search within 1000 mdi or tiff files for a specific text string? Does anyone know any? I have a whole batch of mdi and tiff files that i need to search within it for a specific text string. Thank you

A:Any program that can search within 1000 mdi or tiff files for a specific text string?


Look here for an offering to your problem!

Text Searchable tiff images

Read other 1 answers

Word 2003 Macro question:
I have 14 x 320 page word documents (School subject reports) created via
mail merges. At irregular intervals in each document there will be a page
which I wish to delete (the student does not do this subject). There is text
present from the mail merge template, however the is no data inserted into
this page. For example, on the pages I wish to delete the teacher name is
I have created a macro and attached it to a toolbar so that I can delete the
active page manually as I scroll through the document. However I would rather
have the macro search through the document, and where it finds the string
"Subject Teacher : " with no name next to it, then it can call the delete
page macro I made. However I cannot figure out how to make it search for that
string PLUS the missing teacher name (many different teacher names).
Can anybody help with this?

A:Deleting a Word page based on text search macro

I was offered the following solution on another forum. It works very well.
Thanks to Jean-Guy for this.
Try something like the following. You will need to find a way to determine
the exact string you need to search for when there are no teacher names

Dim strSearch As String
Dim rgeStart As Range

Set rgeStart = Selection.Range

strSearch = "Subject Teacher :" & Chr(13)

With ActiveDocument.Range.Find
.Text = strSearch
Do While .Execute
With .Parent
With Selection
End With
End With
End With


Application.Browser.Target = wdBrowsePage

Read other 1 answers


I am hoping someone can help me here - I am trying to create a macro that prints Current Page based on specific text. I found script from 3 years ago (on this forum) that works nearly perfectly for us with only minor formatting adjustments. I'll post that below, but first want to explain the one change I am trying to make (you'll see I know little about Macros...)

The script below searches in text boxes, I need it to just search the document, not confined to text boxes. We have a series of letters that are generated automatically and then later sent to clients. These are generated in massive numbers, and we only print out the ones that come from our locations (7 in total). Right now we have to eyeball to see which ones we will print, but I know we can build a macro that will do it.

Here is the script I am basing working off of, which I called sort:

(The first part just sets margins to narrow, please ignore, it's the second part where I want to break away from the Text Box requirement and just look at the text within the document, and if it matches, print that page. I appreciate any help with this

Sub Sort()

With Selection.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = CentimetersToPoints(1.27)
.BottomMargin = CentimetersToPoints(1.27)
.LeftMargin = CentimetersToPoints(1.27)
.RightMargin = CentimetersToPoints(1.27)
.Gutter = CentimetersToPoints(0)
.HeaderDistance = CentimetersToPoints(1.25)
.FooterDistance ... Read more

Read other answers

Okay, I seem to be lucky enough to get all of the "weird" situations. I have a three page document and just two areas on page 3 show the words as totally being reversed. The original document was created in Word 2003 (on a PC) and the laptop uses the Microsoft Office 2010. When the document is opened on the laptop, this issue happens, but when I take the same jump drive and open it with the PC using Word 2003, everything is perfect.

Is there any way to fix this on the laptop documents? Any idea what causes this or why it happens?

I saw this before here at work but didn't even realize it had to do with whatever program is opening the existing document until today - duh!


A:Solved: MS Word - some text in document is reversed?

Read other 13 answers

I just sent an e-mail to a doctor but it came back undelivered--apparently the address was out of date. Rather than type it all over again, I assume I can simply copy my e-mail text to a new Word document using the Edit feature. What are the steps to doing that?

A:How To Copy E-mail Text To A New Word Document

That should be quite straightforward. Open your email client and find the original email - there will probably be a copy in the "Sent" or similar named folder. Double click the email to open it in a full window.Press Ctrl+A (i.e. hold down the 'Ctrl' key and press the 'A' key at the same time.) Then press Ctrl+C You can close the email window and minimise the email client at this point.Open word with a new blank document and press Ctrl+V the text from your email should appear in the Word document, the font will be changed to the default Word font but otherwise the text will be the same.Hope that's what you were after.

Read other 5 answers

I am working on a simple word document and I have a font that has both black and white color to it. Is there a way to invert the color of the font? When I invert the color in Paint, it changes the white background to black, too, which I do not want.

Read other answers

hi there - my father is working on a large word document in word 97 - he is not very computer literate and has not been backing up his files. He has somehow managed to delete virtually all of the text on around 160 pages, and this version of his document has been saved (he only has 2 characters on 1 page in total). I have gone into the versions option in the File menu, but there are no previous versions listed, I guess because he had not activated this function. Everything points toward the information being lost, except that if i look in the file's properties it seems that the file still appears to be about the right size (around 660kb). Does this mean that his text may still exist somewhere in the file, and may then be recoverable? (i would have thought with virtually no text the file should be much smaller). It also says that there have been 98 revisions of his documents. Is there any way to access an earlier revision, prior to him deleting all of this text?

I would appreciate any information or advice extremely, even if it is just to clarify that he has lost this file for good.

A:please help - recovering lost text in word 97 document

Read other 8 answers

I am trying to put together a package, made up of several different word documents. Some of the information is the same from one document to another. Is there anyway I can put in a formula or something to have the information transfer to all the different documents, in the appropriate place within the documents, without copying and pasting it each time? Ideally I would like to be able to put the information on the first document, which happens to be a label, and then have certain fields automatically copy to other fields in multiple documents. Not sure if this is possible, or if it is just wishful thinking.
Thank you to anybody who can help me.

A:formula to copy text from one word document to another?

Hi Alanda,

I suspect that what you are trying to do could be accomplished by setting up a macro. GO HERE and see if that will help you out.

Good day!


Read other 3 answers

Is there a simple way to capture a block of text in a Word (2007) document and paste it in another Word document as a graphic image exactly as it is in the source document?
I just discovered that the method I have been using for years actually doesn't work as well as I thought. I had been selecting the text I wanted, copying it to the clipboard (Ctrl+C), then pasting it into the target document using Paste Special (Alt+Ctrl+V) and then selecting Microsoft Word Word Document Object. I then remove the link by selecting the image and using Ctrl+Shift+F9.
I guess I had never copied an entry from the middle of a numbered list before. When I did that just now, I discovered that Word renumbered the list so that it showed up as "1.". The same thing happens if I paste it as an enhanced metafile picture. Putting aside what I consider the idiocy of of this happening, I now need a way to get a copy that has not been reformatted or renumbered. (sheesh)
I tried saving the document as PDF and capturing that text. That's even worse. It comes in as unformatted text.
I tried using a screen capture tool (SnagIt). It works, but the resolution is not great.
After some fiddling around, I discovered a Rube Goldberg procedure that works.
Save the Word document as a PDF.
Open it in Acrobat and save it as a series of pages in png format.
Open the pages I want in something like IrfanView, draw a rectangle around the text I want, copy it to the clipboard, and then pa... Read more

A:Capture text in Word document as graphic

Which version of Windows?Windows Vista (as long as it is not Vista Basic) and newer has the Windows Snipping Tool. It can capture a portion of the screen as an image file than can then be imported/pasted into the document. It may or may not suffer from the same resolution issue you encountered with SnagIt.The other option to try is to turn off the "smart" lists in Word 2007. Personally, I tend to turn those off anyway as they tend to annoy me more than they help me. Here are instructions on how to do that:http://www.technipages.com/word-disable-automatic-numbering-and-bulleting

Read other 1 answers

Is there a simple way to capture a block of text in a Word (2007) document and paste it in another Word document as a graphic image exactly as it is in the source document?
I just discovered that the method I have been using for years actually doesn't work as well as I thought. I had been selecting the text I wanted, copying it to the clipboard (Ctrl+C), then pasting it into the target document using Paste Special (Alt+Ctrl+V) and then selecting Microsoft Word Word Document Object. I then remove the link by selecting the image and using Ctrl+Shift+F9.
I guess I had never copied an entry from the middle of a numbered list before. When I did that just now, I discovered that Word renumbered the list so that it showed up as "1.". The same thing happens if I paste it as an enhanced metafile picture. Putting aside what I consider the idiocy of of this happening, I now need a way to get a copy that has not been reformatted or renumbered. (sheesh)
I tried saving the document as PDF and capturing that text. That's even worse. It comes in as unformatted text.
I tried using a screen capture tool (SnagIt). It works, but the resolution is not great.
After some fiddling around, I tried saving the document in png format. Word saved each page as a separate file, but it works. I can then open the pages I want in something like IrfanView, draw a rectangle around the text I want, copy it to the clipboard, and then paste it to the target document. Using this me... Read more

Read other answers


We have been trying to fix a very large equation in a sheet of paper, but now we feel powerless.

The equation has a curly bracket at the left side, it is a piecewise defined logical relation (similar to a function). The problem is that each lines inside the curly bracket is too long, more than the paper (horizontal or vertical), and if we try to split it in several lines weird things happen, for example if parenthesis are not matched at the end of the line then it does not create a new line in the curly bracket, but inside the parenthesis.

The only solution seems to be to split each line of the equation in several different lines, but looks like that's no possible, there are very big parts inside parenthesis and other stuff. We really have no clue of what to do.

Looks like microsoft word should detect when the line is too long and split it, duplicate operators, etc., but it is not done inside curly brackets.

Thank you for your help and sorry for the bad English.

A:Large equations in word 2007

Maybe nobody knows the answer, or there is no answer. Could we ask this to microsoft?

Never found where to write this question directly to them.

Thank you.

Read other 1 answers

Hi everyone, this is my first post so pardon any mistakes...

I need to create word documents for our product line skus that contain descriptions, pricing an an image of the product. I would like to take the information from our database, create a document for each item and then save the document to a unique name (product#), all done automatically. My thought was to use mail merge for the text fields but I don't know if I can merge images as well. I came across an add-in for word called OnMerge that claims it can automate the merging of images.
My question is multi-part:
1) Has anyone done this using Word 2003 (on XP or W2003 server) ?
2) Has anyone accomplished this using other programs ?
3) Has anyone used OnMerge with Word to create documents as described above ?

Any information that will point me in the right direction would be much appreciated.

Read other answers

I have an end user with Office 2003 Basic. In his Word application he is unable to select text with the mouse. The mouse will work in the toolbar and it works just fine in Excel. He can select text with the arrow key, he can edit the document so it is not protected and you can see the mouse down in the document.

I have uninstalled, reinstalled, did the support.dot, removed, renamed normal.dot as Microsoft as said to do with no luck.

Any help with this problem will be greatly appreciated.

Tixxjava script:emoticon(':dance:', 'smid_11')

A:Mouse Will Not Select Text In Word 2003 Document

I only have a suggestion. Perhaps the Doc is protected. >>Tools>>Unprotect Document

Read other 1 answers

Can someone give me a code sample to insert a small txt file into a completed document. I have a Word 2000 template with a custom userbox and in one of the fields on the userbox, I want to give the option to insert a very small notepad text file into the document, if that option is selected, and I don't know what the code should be. Thanks.

A:Insert a text file into a Word 2000 document

Can someone give me a code sample to insert a small txt file into a completed document. I have a Word 2000 template with a custom userbox and in one of the fields on the userbox, I want to give the option to insert a very small notepad text file into the document, if that option is selected, and I don't know what the code should be. Thanks.

Read other 1 answers

I have a legal form to fill out in WORD and it keeps printing the entries in the text fields in blue. The A text color tool is greyed out. How can I make it black again? I seldom use Office so I'm a newbie at this one.

A:can't change text color in WORD document fields

If the form has been designed as a protected Word document "form" (probably that is the case since it is a "legal form") then they may have formatted it in that manner because that is how they want it filled in, with your content in blue?

Hence the options are unavailable for you to change.

Read other 2 answers