AX operation Word picture

static void Job327(Args _args)
{
com doc = new COM("Word.Application");
com m_docs;
com app;
com ActiveDocument;
com Bookmarks;
com bookmark;
com range;
com sel;
com seal_picture;
str fieldname,imageName,fromfieldName,fromfieldNamePDF;
com seal_shape;
com Activate;
com InlineShapes;
com WrapFormat;
com m_doc;
int tol_shaps,i,j;
Microsoft.Office.Interop.Word.InlineShapes m;
;
//m.get_Creator()
fromfieldName = "C:\\Users\\h2wnf01\\Desktop\\Report\\HCC\\333.rtf";
fromfieldNamePDF = "C:\\Users\\h2wnf01\\Desktop\\Report\\HCC\\333.pdf";
//doc.Visible(true);
m_docs= doc.Documents();
m_doc = m_docs.Add(fromfieldName);
app = doc.Application();
ActiveDocument = doc.ActiveDocument();
InlineShapes = ActiveDocument.InlineShapes();
tol_shaps = InlineShapes.Count();
j = tol_shaps + 1;
for(i = 1;i <= tol_shaps;i++)
{
seal_picture = null;
seal_picture = InlineShapes.Item(ji);
seal_picture.Select();
seal_shape = seal_picture .ConvertToShape(); //Type conversion
WrapFormat = seal_shape.WrapFormat();
WrapFormat.Type(3); //Picture type
seal_shape.ZOrder(4); //5 The picture is in the text 4 The picture is in the text
}
ActiveDocument. SaveAs(fromfieldName);
m_doc.ExportAsFixedFormat(fromfieldNamePDF,17);
doc.quit();

}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324653542&siteId=291194637