12-05-2006, 01:24 PM | #31 | |
Retired & reading more!
Posts: 2,764
Karma: 1884247
Join Date: Sep 2006
Location: North Alabama, USA
Device: Kindle 1, iPad Air 2, iPhone 6S+, Kobo Aura One
|
Quote:
|
|
12-07-2006, 05:13 PM | #32 |
Gadget Force®
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
|
Is it the idea that text in the center like chapter numbers stay in the center with this macro because with me they also go to the left after I ran the macro.
|
Advert | |
|
12-09-2006, 03:40 PM | #33 |
Gadget Force®
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
|
I have added some things to the macro for my personal use but thought that It would be good to share it.
What will it do? It will center all titles, chapter numbers etc. The original Macro alligned everything to the left. It will justify all paragraphs, but it won't affect your centered titles etc. Where to add it in the original macro? Be sure you use the latest original Macro. Add my code just before "End sub" at the end of the original code. I also attached a sample file where you can try my code on in case it doesn't work with your file. Then you can edit where needed. Here is the code: Code:
'This following section will bring left outlined titles/chapters to the center 'and justifies all paragraphs but won't affect titles etc. With Selection.Find 'This prevents paragraphs from being centered. .Text = ".^p" .Replacement.Text = "#*" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find 'Bring left outlined titles/chapters to the center .Text = "^p^p" .Replacement.Text = "" .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With While Selection.Find.Execute Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Wend With Selection.Find 'Restores the paragraph marks at the end of the paragraphs .Text = "#*" .Replacement.Text = ".^p" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:="1" 'Take cursor at beginning of document With Selection.Find 'This step will justify all paragraphs, but not titles etc. .Text = ".^p" .Replacement.Text = "" .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With While Selection.Find.Execute Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify Wend Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Name:="1" 'Take cursor at beginning of document |
01-10-2007, 09:36 AM | #34 | |
Guru
Posts: 632
Karma: 404
Join Date: Nov 2006
Location: Southern CA
Device: Sony PRS-500 /prs 650 soon
|
Quote:
|
|
01-10-2007, 10:00 AM | #35 | |
Guru
Posts: 632
Karma: 404
Join Date: Nov 2006
Location: Southern CA
Device: Sony PRS-500 /prs 650 soon
|
Quote:
Compile Error: Only comments may appear after End Sub, End function or end property. Guess I just don't understand |
|
Advert | |
|
01-10-2007, 10:03 AM | #36 |
Gadget Force®
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
|
Make sure you don't have twice "End sub" on the end.
|
01-10-2007, 10:35 AM | #37 | |
Guru
Posts: 632
Karma: 404
Join Date: Nov 2006
Location: Southern CA
Device: Sony PRS-500 /prs 650 soon
|
Quote:
Sub FormatforSony() ' ' ebook_formatter Macro ' Macro created 11/29/2006 ' ' This step take you to the top of your document Selection.GoTo what:=wdGoToPage, which:=wdGoToNext, Name:="1" ' This step clears formatting and sets font to my preferred size ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting Selection.WholeStory Selection.Font.Name = "Times New Roman" Selection.Font.Size = 14 With Selection.Font .NameFarEast = "" .NameAscii = "Times New Roman" .NameOther = "Times New Roman" .Name = "" .Size = 14 .Bold = False .Italic = False End With ' This step replaces hard page breaks ' With Selection.Find .Text = "^m" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll ' This step replace the correct paragraph mark with a temporary sign "#*#", if your document has that sign, replace ' with some other special character ' With Selection.Find .Text = "^p^p" .Replacement.Text = "#*#" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll ' This step will replace the inappropriate line break with a space. Also see remark below ' With Selection.Find .Text = "^p" .Replacement.Text = " " .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll ' This step will return the paragraph break to normal ' With Selection.Find .Text = "#*#" .Replacement.Text = "^p^p" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll 'this section will remove multiple spaces. If you do not want 'two spaces after the ending period then remove the first and last 'paragraph in this section. ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = ". " .Replacement.Text = "#!#" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With With Selection.Find .Text = "([ ]{2,6})" .Replacement.Text = " " .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "#!#" .Replacement.Text = ". " .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With ' ' FormatforSony Macro ' Macro recorded 1/10/2007 by ' End Sub |
|
01-10-2007, 10:50 AM | #38 |
Gadget Force®
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
|
I tried what you have and it works fine. Could you send me the book to try?
|
01-10-2007, 10:53 AM | #39 |
Guru
Posts: 632
Karma: 404
Join Date: Nov 2006
Location: Southern CA
Device: Sony PRS-500 /prs 650 soon
|
Sure if You send me your email address via pm. I don't see where I can attach it here in the private emails unless I am missing something.
|
01-10-2007, 11:00 AM | #40 |
Gadget Force®
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
|
I sent you a PM.
|
01-10-2007, 11:11 AM | #41 | |
Guru
Posts: 632
Karma: 404
Join Date: Nov 2006
Location: Southern CA
Device: Sony PRS-500 /prs 650 soon
|
Quote:
|
|
01-10-2007, 05:45 PM | #42 | |
Guru
Posts: 632
Karma: 404
Join Date: Nov 2006
Location: Southern CA
Device: Sony PRS-500 /prs 650 soon
|
Quote:
|
|
01-10-2007, 05:52 PM | #43 |
Gadget Force®
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
|
Your more than welcome!
|
01-10-2007, 07:03 PM | #44 |
Technogeezer
Posts: 7,233
Karma: 1601464
Join Date: Nov 2006
Location: Virginia, USA
Device: Sony PRS-500
|
It looks like I will be adding a page or so the the Wiki this weekend on conversion tools like Book Designer and the like. I think the Word Formatting Macro should be there too and will include it in the listing.
|
01-10-2007, 10:36 PM | #45 | |
Gizmologist
Posts: 11,615
Karma: 929550
Join Date: Jan 2006
Location: Republic of Texas Embassy at Jackson, TN
Device: Pocketbook Touch HD3
|
Quote:
|
|
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 |