Skip to content
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

Open failed! #93

Open
szfbit opened this issue Oct 30, 2024 · 0 comments
Open

Open failed! #93

szfbit opened this issue Oct 30, 2024 · 0 comments

Comments

@szfbit
Copy link

szfbit commented Oct 30, 2024

When I opened the Word file in the specified location, it failed to open. Can only open files in fixed locations? For example, files in the build directory?

here is the code.

#include <duckx.hpp>
#include
using namespace std;

int main() {

duckx::Document doc("D:/User/GJB5000/myTest.docx");
doc.open();
std::cout <<"open状态:" <<doc.is_open();
duckx::Paragraph p;
p = doc.paragraphs();
p.add_run("Chinese Chinese \r\n");
p.add_run("italic, ", duckx::none);
p.add_run("bold, ", duckx::bold);
p.add_run("underline, ", duckx::strikethrough);
p.add_run("superscript", duckx::superscript);
p.add_run(" or ");
p.add_run("subscript, ", duckx::subscript);
p.add_run("small caps, ", duckx::smallcaps);
p.add_run("and shadows, ", duckx::shadow);
p.add_run("and of course ");
p.add_run("combine them.", duckx::bold | duckx::italic | duckx::underline |
                               duckx::smallcaps);
p.add_run("and Chinese Chinese ");
doc.save();

return 0;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant