You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to add page numbers to my document in the footer using the sample example provided. The document was created successfully but there's a prompt of 'This document contains fields that may refer to other files. Do you want to update the fields in this document?'
The content of the document is correct though even though I click No for the prompt
Here's my code for the footer
doc := document.New()
ftr := doc.AddFooter()
para := ftr.AddParagraph()
run := para.AddRun()
run.AddText("Test")
run.AddTab()
run.AddTab()
run.AddField(document.FieldCurrentPage)
run.AddText(" of ")
run.AddField(document.FieldNumberOfPages)
doc.BodySection().SetFooter(ftr, wml.ST_HdrFtrDefault)
The text was updated successfully, but these errors were encountered:
kkesley
changed the title
Using run.AddField(document.FieldNumberOfPages) for footer produces document contains fields that may refer to other files prompt
Using run.AddField(document.FieldNumberOfPages) for footer produces "document contains fields that may refer to other files" prompt
Mar 29, 2018
I added this originally as the fields I was using (e.g. TOC) required the update to generate the content, otherwise the table of contents would be blank. It looks like in your case, it's not absolutely needed.
I'm not sure of the best way to fix this, either a flag to indicate if the field should be marked as dirty or a separate method. I'll look into it, but if you need a quick fix setting DirtyAttr to nil through the X() method should work.
Thanks! @tbaliance btw I'm updating the library with dep ensure -update baliance.com/gooxml but it still uses AddFieldWithFormatting(code string, fmt string). but if I use go get, it's picking the right version. do you know why it happens?
Hi, I'm trying to add page numbers to my document in the footer using the sample example provided. The document was created successfully but there's a prompt of 'This document contains fields that may refer to other files. Do you want to update the fields in this document?'
The content of the document is correct though even though I click No for the prompt
Here's my code for the footer
The text was updated successfully, but these errors were encountered: