Home |
Search |
Today's Posts |
|
#1
|
|||
|
|||
Jack,
To delete the text and the frame it would be ActiveDocument.Frames(i).Range.Delete 'deletes the text ActiveDocument.Frames(i).Delete 'deletes the frame -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Jack Sons wrote: Greg, Your help was enormous! What you wrote (I found through experimentation that if I just deleted the frames then any border and fill effects in the frame would be transfered to the text paragraphs.) enlightened me, now I understand. Of course I thought that with deleting the frame and its border one would also lose the text. Apparently that is not the case. Thanks again. Jack. "Greg Maxey" gro.spvm@yexamg (thats my e-mail address backwards) schreef in bericht ... Jack, I am afraid that my usefulness to you has about run its course :-) The code does look at all shapes, if the shape is a textbox it converts it to a frame, removes any borders and fill effects from the frame and then deletes the frame leaving the text. I found through experimentation that if I just deleted the frames then any border and fill effects in the frame would be transfered to the text paragraphs. I will have to defer to others as to the technical difference between a frame and textbox. RTF is, I think, "Raw Text Format." I have never monkeyed around very much with differenct types of text, but why don't you just try saving your RTF file as a Word.doc and see what happens :-) I have a hard time figuring out the workings of a simple screw, so I can't be of much help with the workings of your scanner. Sorry. -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Jack Sons wrote: Greg, Thank you for your macro, it worked. How did it work? I think it converts each textbox to a frame without (visible) borders. What is the essential difference between a textbox and a frame ? And what is done with the frames, I can't find them in the result. To me it looks like a normal document, without any objects, just characters as it should be. Would the result of using "the plain text output of the software", as Graham advised, (if I would know how to do that) give a different result? Before and after the use of the macro the resulting document is a rtf-file (result.rtf). What does that extension inplicate? Can I rename it as a doc-file (result.doc) without repercussions? Last question (for now): why does the scanning process result in a textbox output in stead of "normal text"? Jack. "Greg Maxey" gro.spvm@yexamg (thats my e-mail address backwards) schreef in bericht ... Jack Sons, Yes Graham is probably right. I cobbled together the following which first converts textboxes to frames and then removes the frame. Sub ScratchMacro() 'Convert textbox text to plain text Dim oShp As Shape Dim i As Integer For Each oShp In ActiveDocument.Shapes If oShp.Type = msoTextBox Then oShp.ConvertToFrame Next oShp For i = ActiveDocument.Frames.Count To 1 Step -1 With ActiveDocument.Frames(i) .Borders.Enable = False With .Shading .Texture = wdTextureNone .ForegroundPatternColor = wdColorAutomatic .BackgroundPatternColor = wdColorAutomatic End With .Delete End With Next End Sub -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Jack Sons wrote: Hi all, I scanned a document of may pages. The result (a rtf-file) looks fine, but in reality the text I see is not "text in a document" but text in textboxes. I really need this to convert to text "directly in the document", like in any "normal" document. I mean that it will be as if I typed it directly into the document. Of course I could select (highlight) the text in the first textbox and than paste it to a new document (a doc-file), do the same with the text of the next textbox, past it below the first text in the new docment etc. I tried, did it for a lot of textboxes, but it will be very tedious to do it with the whole document because of the many hundreds - maybe thouthands - of textboxes, some of which contain only a single line of text.. Also there is a strange effect, when I try to "control c - control v " the highlighted text of a textbox to the other document, suddenly it is not the text that is copied to the new document, but the whole textbox, and so it just moved the problem from one document to the other one. Can anyone show me a way out? Perhaps with VBA it will be possible to convert all textboxes at once to normal text. I am in very urgent need for advice. Please help. Jack Sons The Netherlands |
#2
|
|||
|
|||
Greg,
ActiveDocument.Frames(i).Delete is what your macro did, it deletes the frame and leaves the text. I see it now in your code. At first I thought that deleting the frame would also delete the text. But now I understand that "frame" is just a rectangle of borderlines within the text layer of the document. ActiveDocument.Frames(i).Range.Delete will delete the text and keeps the frame intact. So an empty frame (borders - if visible - without any text inside) is the result? Does that mean that you can't delete frame and text with one instruction? Jack. "Greg Maxey" gro.spvm@yexamg (thats my e-mail address backwards) schreef in bericht ... Jack, To delete the text and the frame it would be ActiveDocument.Frames(i).Range.Delete 'deletes the text ActiveDocument.Frames(i).Delete 'deletes the frame -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Jack Sons wrote: Greg, Your help was enormous! What you wrote (I found through experimentation that if I just deleted the frames then any border and fill effects in the frame would be transfered to the text paragraphs.) enlightened me, now I understand. Of course I thought that with deleting the frame and its border one would also lose the text. Apparently that is not the case. Thanks again. Jack. "Greg Maxey" gro.spvm@yexamg (thats my e-mail address backwards) schreef in bericht ... Jack, I am afraid that my usefulness to you has about run its course :-) The code does look at all shapes, if the shape is a textbox it converts it to a frame, removes any borders and fill effects from the frame and then deletes the frame leaving the text. I found through experimentation that if I just deleted the frames then any border and fill effects in the frame would be transfered to the text paragraphs. I will have to defer to others as to the technical difference between a frame and textbox. RTF is, I think, "Raw Text Format." I have never monkeyed around very much with differenct types of text, but why don't you just try saving your RTF file as a Word.doc and see what happens :-) I have a hard time figuring out the workings of a simple screw, so I can't be of much help with the workings of your scanner. Sorry. -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Jack Sons wrote: Greg, Thank you for your macro, it worked. How did it work? I think it converts each textbox to a frame without (visible) borders. What is the essential difference between a textbox and a frame ? And what is done with the frames, I can't find them in the result. To me it looks like a normal document, without any objects, just characters as it should be. Would the result of using "the plain text output of the software", as Graham advised, (if I would know how to do that) give a different result? Before and after the use of the macro the resulting document is a rtf-file (result.rtf). What does that extension inplicate? Can I rename it as a doc-file (result.doc) without repercussions? Last question (for now): why does the scanning process result in a textbox output in stead of "normal text"? Jack. "Greg Maxey" gro.spvm@yexamg (thats my e-mail address backwards) schreef in bericht ... Jack Sons, Yes Graham is probably right. I cobbled together the following which first converts textboxes to frames and then removes the frame. Sub ScratchMacro() 'Convert textbox text to plain text Dim oShp As Shape Dim i As Integer For Each oShp In ActiveDocument.Shapes If oShp.Type = msoTextBox Then oShp.ConvertToFrame Next oShp For i = ActiveDocument.Frames.Count To 1 Step -1 With ActiveDocument.Frames(i) .Borders.Enable = False With .Shading .Texture = wdTextureNone .ForegroundPatternColor = wdColorAutomatic .BackgroundPatternColor = wdColorAutomatic End With .Delete End With Next End Sub -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Jack Sons wrote: Hi all, I scanned a document of may pages. The result (a rtf-file) looks fine, but in reality the text I see is not "text in a document" but text in textboxes. I really need this to convert to text "directly in the document", like in any "normal" document. I mean that it will be as if I typed it directly into the document. Of course I could select (highlight) the text in the first textbox and than paste it to a new document (a doc-file), do the same with the text of the next textbox, past it below the first text in the new docment etc. I tried, did it for a lot of textboxes, but it will be very tedious to do it with the whole document because of the many hundreds - maybe thouthands - of textboxes, some of which contain only a single line of text.. Also there is a strange effect, when I try to "control c - control v " the highlighted text of a textbox to the other document, suddenly it is not the text that is copied to the new document, but the whole textbox, and so it just moved the problem from one document to the other one. Can anyone show me a way out? Perhaps with VBA it will be possible to convert all textboxes at once to normal text. I am in very urgent need for advice. Please help. Jack Sons The Netherlands |
#3
|
|||
|
|||
Jack,
That is my understaning, but I don't like to use "can't" as I am just a novice with VBA. Actually I suppose that I would write the code: With ActiveDocument.Frames(i) .Range.Delete .Delete End With If we are wrong, Jay or one of the other Senseis will be along to set us straight ;-) Here is a little piece of code that creates a frame with text. If your leave out part of the code that inserts the text then you just have an empty frame: Public Sub FrameMaker() Dim MyFrame As Frame Dim MyRange As Range Set MyRange = Selection.Range Set MyFrame = ActiveDocument.Frames.Add(MyRange) With MyFrame 'Add color .Shading.BackgroundPatternColor = wdColorLightYellow 'Size it .WidthRule = wdFrameExact .Width = 460 .HeightRule = wdFrameExact .Height = 20 'Position it .RelativeHorizontalPosition = wdRelativeHorizontalPositionPage .RelativeVerticalPosition = wdRelativeVerticalPositionParagraph .HorizontalPosition = 75 .VerticalPosition = 0 'Add some text .Range.InsertAfter "This is a macro created frame!" End With Set MyFrame = Nothing End Sub -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Jack Sons wrote: Greg, ActiveDocument.Frames(i).Delete is what your macro did, it deletes the frame and leaves the text. I see it now in your code. At first I thought that deleting the frame would also delete the text. But now I understand that "frame" is just a rectangle of borderlines within the text layer of the document. ActiveDocument.Frames(i).Range.Delete will delete the text and keeps the frame intact. So an empty frame (borders - if visible - without any text inside) is the result? Does that mean that you can't delete frame and text with one instruction? Jack. "Greg Maxey" gro.spvm@yexamg (thats my e-mail address backwards) schreef in bericht ... Jack, To delete the text and the frame it would be ActiveDocument.Frames(i).Range.Delete 'deletes the text ActiveDocument.Frames(i).Delete 'deletes the frame -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Jack Sons wrote: Greg, Your help was enormous! What you wrote (I found through experimentation that if I just deleted the frames then any border and fill effects in the frame would be transfered to the text paragraphs.) enlightened me, now I understand. Of course I thought that with deleting the frame and its border one would also lose the text. Apparently that is not the case. Thanks again. Jack. "Greg Maxey" gro.spvm@yexamg (thats my e-mail address backwards) schreef in bericht ... Jack, I am afraid that my usefulness to you has about run its course :-) The code does look at all shapes, if the shape is a textbox it converts it to a frame, removes any borders and fill effects from the frame and then deletes the frame leaving the text. I found through experimentation that if I just deleted the frames then any border and fill effects in the frame would be transfered to the text paragraphs. I will have to defer to others as to the technical difference between a frame and textbox. RTF is, I think, "Raw Text Format." I have never monkeyed around very much with differenct types of text, but why don't you just try saving your RTF file as a Word.doc and see what happens :-) I have a hard time figuring out the workings of a simple screw, so I can't be of much help with the workings of your scanner. Sorry. -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Jack Sons wrote: Greg, Thank you for your macro, it worked. How did it work? I think it converts each textbox to a frame without (visible) borders. What is the essential difference between a textbox and a frame ? And what is done with the frames, I can't find them in the result. To me it looks like a normal document, without any objects, just characters as it should be. Would the result of using "the plain text output of the software", as Graham advised, (if I would know how to do that) give a different result? Before and after the use of the macro the resulting document is a rtf-file (result.rtf). What does that extension inplicate? Can I rename it as a doc-file (result.doc) without repercussions? Last question (for now): why does the scanning process result in a textbox output in stead of "normal text"? Jack. "Greg Maxey" gro.spvm@yexamg (thats my e-mail address backwards) schreef in bericht ... Jack Sons, Yes Graham is probably right. I cobbled together the following which first converts textboxes to frames and then removes the frame. Sub ScratchMacro() 'Convert textbox text to plain text Dim oShp As Shape Dim i As Integer For Each oShp In ActiveDocument.Shapes If oShp.Type = msoTextBox Then oShp.ConvertToFrame Next oShp For i = ActiveDocument.Frames.Count To 1 Step -1 With ActiveDocument.Frames(i) .Borders.Enable = False With .Shading .Texture = wdTextureNone .ForegroundPatternColor = wdColorAutomatic .BackgroundPatternColor = wdColorAutomatic End With .Delete End With Next End Sub -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Jack Sons wrote: Hi all, I scanned a document of may pages. The result (a rtf-file) looks fine, but in reality the text I see is not "text in a document" but text in textboxes. I really need this to convert to text "directly in the document", like in any "normal" document. I mean that it will be as if I typed it directly into the document. Of course I could select (highlight) the text in the first textbox and than paste it to a new document (a doc-file), do the same with the text of the next textbox, past it below the first text in the new docment etc. I tried, did it for a lot of textboxes, but it will be very tedious to do it with the whole document because of the many hundreds - maybe thouthands - of textboxes, some of which contain only a single line of text.. Also there is a strange effect, when I try to "control c - control v " the highlighted text of a textbox to the other document, suddenly it is not the text that is copied to the new document, but the whole textbox, and so it just moved the problem from one document to the other one. Can anyone show me a way out? Perhaps with VBA it will be possible to convert all textboxes at once to normal text. I am in very urgent need for advice. Please help. Jack Sons The Netherlands |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mirror Text Box | Formatting Long Documents | |||
help, problem with text field in word 2003 | Microsoft Word Help | |||
Text wrapping around an image or textbox | Formatting Long Documents | |||
Excel worksheet in Word linked text boxes | Page Layout | |||
Outline | Page Layout |