Fields, Links, And Review Notes¶
Field, hyperlink, note, comment, and revision APIs are available on
featherdoc::Document. Field and hyperlink operations that can be scoped to a
body, header, footer, or section part are also available on
featherdoc::TemplatePart.
Typed Signature Guide¶
Field, hyperlink, note, comment, and revision indexes are zero-based and come
from the corresponding list_* method. Append methods returning
std::size_t return a created count. Methods returning bool report
whether a specific indexed item was changed.
Signature |
Parameters |
Return semantics |
|---|---|---|
|
None. |
Field summaries in the selected document part. |
|
|
|
|
|
|
|
|
Created hyperlink count; |
|
|
Created comment count; |
|
|
|
|
|
|
|
None. |
Number of tracked revisions accepted. |
Summary Types¶
Type |
Key fields |
Purpose |
|---|---|---|
|
|
Describes a simple or complex Word field. |
|
|
Describes an internal or external hyperlink. |
|
|
Describes footnotes, endnotes, comments, and comment replies. |
|
|
Describes tracked insertions, deletions, and related revision records. |
Fields¶
Method |
Returns |
Purpose |
|---|---|---|
|
|
Enumerate fields in the selected document part. |
|
|
Append a simple field instruction and optional display result. |
|
|
Append a complex Word field. |
|
|
Append a PAGE field. |
|
|
Append a NUMPAGES field. |
|
|
Append a TOC field. |
|
|
Append a REF field that points at a bookmark. |
|
|
Replace a field instruction and result by index. |
Hyperlinks¶
Method |
Returns |
Purpose |
|---|---|---|
|
|
Enumerate hyperlinks. |
|
|
Append a hyperlink and return the created hyperlink count; |
|
|
Replace hyperlink text and target. |
|
|
Remove one hyperlink. |
Notes, Comments, And Revisions¶
Method |
Returns |
Purpose |
|---|---|---|
|
|
Enumerate footnotes or endnotes. |
|
|
Append a footnote. |
|
|
Append an endnote. |
|
|
Replace one footnote. |
|
|
Remove one endnote. |
|
|
Enumerate comments. |
|
|
Append a comment anchored to selected text. |
|
|
Comment a text range. |
|
|
Mark a comment resolved or unresolved. |
|
|
Enumerate tracked revisions. |
|
|
Resolve one revision. |
|
|
Resolve all tracked revisions. |
Example¶
featherdoc::Document doc{"review.docx"};
doc.open();
auto body = doc.body_template();
body.append_page_number_field();
body.append_hyperlink("FeatherDoc", "https://github.com/wuxianggujun/FeatherDoc");
for (const auto &comment : doc.list_comments()) {
if (!comment.resolved) {
doc.set_comment_resolved(comment.index, true);
}
}