Help with one or two things when I build a PBB.

Page 1 of 1 (9 items)
This post has 8 Replies | 1 Follower

Posts 165
Gerald Rodgers | Forum Activity | Posted: Tue, May 19 2015 7:40 AM

Hi folks

I have read with interest the several posts re Personal Books - Do you know this wonderful piece of software. I have used Nuance software with good effect although when I use the software to change a PDF to a docx file I find the docx file looks OK until I transfer it into my files within Logos 6.

Is there an easy way to remove the page numbers from the docx file and how do I get rid of page breaks which are not obvious until I open the file in Logos6? These seem to be the two problems I encounter at the moment. Any help would be appreciated. Thanks so much.

Kind regards

Gerald

Posts 64
Hermann Fritz | Forum Activity | Replied: Tue, May 19 2015 8:21 AM

Hello Gerald,

I don´t know, if this could solve your Problem, but you should give it a try:

I found a macro, which erases the textframes. I mentioned it before in my posts about Nuance (see below in this post). If you start the macro, your docx-document can be easily marked. There is also a helpful link, where you get good instructions to remove Tags, Page Numbers etc. from your documents. Please follow this link:

https://jwmanus.wordpress.com/cheat-sheets-for-ebook-formatting/clean-source-file/

Greetings from Cologne, Germany.

Although Nuance created a surprisingly good Docx file, the text was divided into many hundreds of text frames. Logos can not handle such a format. Therefore, one must first get rid of the text frame automatically. How this is done you can find described here: http://wordribbon.tips.net/T009169_Removing_All_Text_Boxes_In_a_Document.html

I've taken the mentioned macro and thus resolved the old format. It is here:

Sub RemoveTextBox2()
    Dim shp As Shape
    Dim oRngAnchor As Range
    Dim sString As String

    For Each shp In ActiveDocument.Shapes
        If shp.Type = msoTextBox Then
            ' copy text to string, without last paragraph mark
            sString = Left(shp.TextFrame.TextRange.Text, _
              shp.TextFrame.TextRange.Characters.Count - 1)
            If Len(sString) > 0 Then
                ' set the range to insert the text
                Set oRngAnchor = shp.Anchor.Paragraphs(1).Range
                ' insert the textbox text before the range object
                oRngAnchor.InsertBefore _
                  "Textbox start << " & sString & " >> Textbox end"
            End If
            shp.delete
        End If
    Next shp
End Sub
Posts 3003
David Taylor Jr | Forum Activity | Replied: Tue, May 19 2015 10:56 AM

Are the page numbers in the header or footer? I know when I open a PDF in word it often puts them in header or footers. At that point you can use the "Inspect Document" tool to remove all headers and footers.

Teacher, Ministry Leader, Student, Author, Husband

How to upload logs

Visit My Site: Reformed Truths

Posts 1699
Robert M. Warren | Forum Activity | Replied: Thu, May 21 2015 11:11 AM

David Taylor Jr:
Are the page numbers in the header or footer?

I think the PB compiler ignores headers and footers in Word, since it also ignores Word pagination.

Win 10 Android 8.1 Fire OS 5

Posts 381
Calvin Habig | Forum Activity | Replied: Thu, May 21 2015 12:43 PM

You manually insert the page number within the text wherever the page break is.  Ex:

The quick fox jumped [[@Page:23]] over the brown dog. 

Posts 612
John Brumett | Forum Activity | Replied: Thu, May 21 2015 6:44 PM

I tried to create a Macro in Word but I get "Compile Error Invalid Outside Procedure" can you help?

Posts 64
Hermann Fritz | Forum Activity | Replied: Fri, May 22 2015 1:08 AM

Hello John,

a Microsoft Moderator ( http://jay-freedman.info ) writes:


A procedure starts with "Sub <procedure name> ()" or "Function <procedure name> () As <data type>", and it ends with the matching line "End Sub" or "End Function". Almost everything else must be between those lines, except for lines starting with the words "Dim", "Const", "Public", and a few others.

If you have a line that tries to set a variable's value, or that calls another procedure, and that line isn't between Sub and End Sub, or between Function and End Function, then you get that compile error message.

The usual fix is to move the line inside a procedure where it belongs. I hope, it answers your request ... I remember that I also had to replace a SUB variable, when I tested this macro on a pdf-file of the Gesenius-Lexicon. At the End, it was a Success. Greetings from Cologne, Germany, on a sunny day Cool Hermann
Posts 165
Gerald Rodgers | Forum Activity | Replied: Mon, May 25 2015 2:40 AM

Hi Herman

Thanks to you and the others for help on my question. Just wondering if you can tell me how to

run a macro in Word 2013 and whether or not it needs to be modified in the light of the above post

you wrote re a "fix". Can I cut and paste the one you mentioned in your first post plus a fix if needed

and then how exactly do I run it? It's just I'm an amateur when it comes to technical stuff like macros!

Best wishes all the way from Northern Ireland.

Kind regards

Gerald

Posts 64
Hermann Fritz | Forum Activity | Replied: Mon, May 25 2015 10:06 AM

Hello Gerald, in the meantime I tested the macro above again in a short document with a lot of text frames. I think I inserted the correct and full functional batch. If you copy and paste the script mentioned above in your macro-editor, it should function without failure.
Because I am working with word 2007, you have to transfer this in your newer word 2013. Follow these Links to learn, how to edit a macro in your textwriter.

https://www.youtube.com/watch?v=nQ_zLItkL5U

https://www.youtube.com/watch?v=xp-a5RExfkg

After you have executed the macro, you can go to the search button in word and seek the phrases "Textbox start <<" or ">> Textbox end" in order to delete them all from your document.

By the way: You must know that the macro changes the formats of your documents. Therefore, you will have to do some further "handwork".

I hope, this will solve your above request. If you have further questions, feel free to ask. I will help, if I can. Smile

Greetings to Northern Ireland from Germany,

Hermann 

Page 1 of 1 (9 items) | RSS