-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text not being inserted after bookmark #111
Comments
Thank you for reporting this bug. I just reproduced this problem and the saved docx file does not work. |
I have analyzed Its <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"
xmlns:w10="urn:schemas-microsoft-com:office:word"
xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml"
xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main"
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart"
xmlns:lc="http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas"
xmlns:dgm="http://schemas.openxmlformats.org/drawingml/2006/diagram"
xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"
xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"
xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml"
xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml">
<w:background w:color="FFFFFF"/>
<w:body>
<w:bookmarkStart w:colFirst="0" w:colLast="0" w:name="cypsldshvlxb" w:id="0"/>
<w:bookmarkEnd w:id="0"/>
<w:p w:rsidR="00000000" w:rsidDel="00000000" w:rsidP="00000000" w:rsidRDefault="00000000" w:rsidRPr="00000000" w14:paraId="00000001">
<w:pPr>
<w:rPr>
<w:rFonts w:ascii="Arial" w:cs="Arial" w:eastAsia="Arial" w:hAnsi="Arial"/>
<w:b w:val="1"/>
</w:rPr>
</w:pPr>
<w:r w:rsidDel="00000000" w:rsidR="00000000" w:rsidRPr="00000000">
<w:rPr>
<w:rFonts w:ascii="Arial" w:cs="Arial" w:eastAsia="Arial" w:hAnsi="Arial"/>
<w:b w:val="1"/>
<w:rtl w:val="0"/>
</w:rPr>
<w:t xml:space="preserve">bookmark_1</w:t>
</w:r>
</w:p>
I have one question: How is this docx file generated? |
Hi @satoryu! That's interesting - this was generated using Google Docs. |
Ah... I confirmed that Google Docs generates a docx file with the problem I mentioned. |
Describe the bug
I have the following class to read from a template and create a new docx file:-
require 'docx'
Most of the above is pulled from the README docs for this gem.
The new file is saved without any errors, but the code which inserts text "Hello, world", has no effect. The text substitution in the table works fine, as well as the new row insertion.
I got the bookmark name by just using the below, so I know it exists, but maybe I'm using the wrong name for it?:-
Does anyone know what I could be doing wrong?
To Reproduce
Use class/file above and run the method against a document with a few bookmarks.
Sample docx file
sample.docx
Expected behavior
Expected all text inserts after bookmarks to work.
Environment
docx
gem version: [0.6.1]The text was updated successfully, but these errors were encountered: