11-06-2007, 02:36 PM | #61 |
Enthusiast
Posts: 28
Karma: 10
Join Date: Oct 2007
Location: Mancehster, CT
Device: Sony Prs505
|
What a mess! Gotta work with this some!
So I got the macro copied fine and created the macro. Took a completed ebook that was formatted just right in BD, copied it to word and ran the macro. UGGGH! No more paragraphs, spaces, titles, etc. My first macro so I guess I will just have to learn a bit and selectively use it in Word 2007. Heh!
"What I don't know about Macros would fill a book." |
11-06-2007, 03:46 PM | #62 |
Guru
Posts: 746
Karma: 2825929
Join Date: Feb 2007
Location: Fresno
Device: Kindle 1; iPad Air; iPhone 7; Kobo Libra; Kindle Oasis 3
|
Hopefully, some more knowledgeable person will weigh in on this. My first attempts at using Stingo's macro were on things published on the web and available only in text and it gave the same results: a solid block of words without paragraphs -- pages and pages of it. But I've since used the macro on books in Gutenburg that were only available in text and it worked beautifully. So some things don't work with that macro. No idea why not.
Jim |
Advert | |
|
11-06-2007, 03:50 PM | #63 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The problem is that some txt files use a empty line to indicate paragraph changes while some use indented texts. A particular cleanup method, like Stingo's macro will assume one technique and work well on files that follow that convention.
|
11-14-2007, 11:12 PM | #64 |
Connoisseur
Posts: 62
Karma: 133
Join Date: Oct 2007
Location: Minnesota, USA
Device: Kobo Aura Edition 2
|
Someone a while back asked about a Word macro to convert text marked with underscores to italics. This code works for me:
Code:
Sub UnderscoresToItalics() ' ' UnderscoreToItalics Macro ' Macro recorded 11/14/2007 by Stephen Lins ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "_<*_" .Replacement.Text = "^&" .Forward = True .Wrap = wdFindContinue .Format = True .Replacement.Font.Italic = wdToggle .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True End With Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "_" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End Sub |
11-15-2007, 04:37 AM | #65 |
The Introvert
Posts: 8,307
Karma: 1000077497
Join Date: Jan 2007
Location: United Kingdom
Device: Sony Reader PRS-650 & 505 & 500
|
Could someone tell me how to use this code?
or point to a book/internet where I can read about it? I think it is called macros? I have no idea how to use them... |
Advert | |
|
11-15-2007, 07:01 PM | #66 |
Connoisseur
Posts: 62
Karma: 133
Join Date: Oct 2007
Location: Minnesota, USA
Device: Kobo Aura Edition 2
|
astra_lestat, macros are programs that run within a particular application and automate a process that the user would otherwise have to do manually each time. The macros in this thread are for Microsoft Word. See this post: https://www.mobileread.com/forums/sho...5&postcount=18 earlier in this thread to learn how to use macros within Word.
|
01-13-2008, 03:14 AM | #67 |
Enthusiast
Posts: 28
Karma: 10
Join Date: Oct 2007
Location: Mancehster, CT
Device: Sony Prs505
|
I need to convert text that has unwanted Paragraph breaks in the middle of sentences, like this (I is indent and P is Paragraph break)
I 'Are you a doctor, sir?' His voice held polite disbelief, which it was P I entitled to, no doubt. I shook my head impatiently. He glanced at P I Donald, pursed his lips, and turned back to me. His gaze wandered P I briefly over my jeans, faded denim jacket, polo-neck, and desert P I boots, and returned to my face, unimpressed. P to Regular paragraphs like this: I 'Are you a doctor, sir?' His voice held polite disbelief, which it was entitled to, no doubt. I shook my head impatiently. He glanced at Donald, pursed his lips, and turned back to me. His gaze wandered briefly over my jeans, faded denim jacket, polo-neck, and desert boots, and returned to my face, unimpressed. P Is there a way to do it in VB? |
01-22-2008, 05:41 PM | #68 |
Resident Curmudgeon
Posts: 73,975
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
JohnP, do you have a line space to delineate the start of the next paragraph or some way to tell where the next paragraph starts? If not, you can't do it by a software method.
|
01-24-2008, 09:07 AM | #69 |
Groupie
Posts: 156
Karma: 25846
Join Date: Apr 2007
Location: UK
Device: PRS505
|
New Macro for formatting books
All:
Over some time during converting some paper books to electronic edition I have developed my own set of macros for repairing book files. It does the following..... removes forced CR's (the macro tries to find paragraphs by looking at the end of the proceding line for valid 'end of paragraph patterns' like the full stop for example. Although not infallible I found it works a treat for general documents.) removes multiple spaces and loops until all gone set entire doc font removes multiple rejection characters fixes lower case ' i ' to ' I ' looks for and highlights (for review) anomolous single lower case letters and numbers. fixes common ocr punctuation errors marks for review other common ocr mistakes. when it finishes it sets the word 'find' field the to (common) ocr rejection characater '~'. so you can start hitting 'find next' to review anything highlighted various other bits and bats. This macro will probably break anything with formulas in it and poetry. It's relatively easy to follow if you read it slowly, you should be able to customise it to your own needs. If your completely clueless as to macro code and don't want to read through it, backup your file before using! ( in fact, backup your files anyway!) It will make a little mess of chapter lines - so they will need to be reviewed after running. I've attached it to this post, I have added comments to it to help clarify what each part does. The file contains a lot of little macros each doing a seperate part, to run them all in order there is a macro called 'main' assign this to a toolbar button and away you go! |
01-25-2008, 12:50 PM | #70 |
Enthusiast
Posts: 28
Karma: 10
Join Date: Oct 2007
Location: Mancehster, CT
Device: Sony Prs505
|
As a matter of fact, there are spaces between paragraphs. However, I could just highlight the offending paragraph (lot of work that would be too!)
|
05-09-2008, 08:01 PM | #71 |
Junior Member
Posts: 1
Karma: 10
Join Date: May 2008
Device: sony
|
problem using in office 2007
i don't know how to apply to office 2007
it keep brings me this pop up screen, how do i disable? |
05-09-2008, 08:12 PM | #72 |
Technogeezer
Posts: 7,233
Karma: 1601464
Join Date: Nov 2006
Location: Virginia, USA
Device: Sony PRS-500
|
|
05-22-2009, 05:53 PM | #73 |
Member
Posts: 13
Karma: 10
Join Date: Apr 2009
Device: Amazon Kindle 3
|
I just tried this macro and I am getting this error on Word:
Compile error: Syntax error and it highlights the line: title_author_form.Authorbox = ActiveDocument.BuiltInDocumentProperties("Author") .Value Can someone help me solve this problem, please? |
05-23-2009, 06:49 PM | #74 |
Junior Member
Posts: 1
Karma: 10
Join Date: May 2009
Device: PRS-505
|
Remove space to fix macro
Hi Strato girl,
I installed the macro last night and got that error as well. There is a typo in the code. Just remove the un-needed space before ".Value" and save it. It should work after that. title_author_form.Authorbox = ActiveDocument.BuiltInDocumentProperties("Author")_.Value tcomeau16 |
05-27-2009, 05:38 AM | #75 | |
Member
Posts: 13
Karma: 10
Join Date: Apr 2009
Device: Amazon Kindle 3
|
Quote:
I will correct it and try again. |
|
Tags |
content, conversion, formatting |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word Macro: Footnotes to inline text ? | Hadrien | Workshop | 17 | 10-08-2011 01:28 PM |
Macro photos of Vizplex E Ink | Magnesus | General Discussions | 4 | 04-23-2010 03:04 PM |
Spelling Macro | PieOPah | Workshop | 36 | 12-13-2008 02:27 AM |
Emdash - punctuation macro | ProDigit | Sony Reader | 8 | 11-28-2008 02:32 AM |
Macro help - Itals from txt | edbro | Sony Reader | 14 | 11-16-2007 07:47 PM |