代码如下,doc就是Document对象
SectionCollection sections = doc.getSections(); for (int i = 0; i < sections.getCount(); i++) { Section section = sections.get(i); // 获取所有段落 ParagraphCollection paragraphs = section.getParagraphs(); for (int j = 0; j < paragraphs.getCount(); j++) { Paragraph paragraph = paragraphs.get(j); // 循环段落中每个内容 for (Object childObject : paragraph.getChildObjects()) { if (childObject instanceof DocPicture) { DocPicture docPicture = (DocPicture) childObject; docPicture.setWidth(1000); docPicture.setHeight(400); } } } }