# Region obtains the signature image of each user and inserts the image into the file.
String struser = string. empty;
Arraylist lstuser = new arraylist ();
For (INT I = 0; I <users. length; I ++)
{
Struser = users [I];
If (struser! = NULL)
{
Lstuser = businessfacade. sys_userlistbyucname (struser );
If (lstuser = NULL)
Usersmark [I] = string. empty;
Else
{
For (int ii = 0; II <lstuser. Count; II ++)
{
Sys_usertable ST = lstuser [II] As sys_usertable;
Usersmark [I] + = ST. u_mark + ",";
}
}
}
}
// Add the corresponding bookmarks to the Word template first. // the following code uses the bookmarks to insert an image to confirm the image position
// User bookmarks
String [] BK = {"analyzer", "corrector", "verifier "};
// Root directory of the user Image
String basepic = httpcontext. Current. server. mappath ("~ /Public/usermark /");
Foreach (word. Bookmark BM in Doc. bookmarks)
{
For (INT I = 0; I <bk. length; I ++)
{
If (BM. Name. tolower () = BK [I]. tolower ())
{
BM. Select ();
If (usersmark [I]. endswith (","))
Usersmark [I] = usersmark [I]. substring (0, usersmark [I]. Length-1 );
String [] PIC = usersmark [I]. Split (',');
For (int ii = 0; II <PIC. length; II ++)
{
// -- Determines whether the logo image exists. If the logo image does not exist, it is skipped.
If (file. exists (basepic + PIC [II])
{
// The image file to be inserted
App. selection. inlineshapes. addpicture (basepic + PIC [II], ref omissing );
}
// Doc. application. activedocument. inlineshapes [1]. width = 100f; // Image Width
// Doc. application. activedocument. inlineshapes [1]. Height = 8f; // Image Height
} Break;
}
}
}
# Endregion