When i am writing the images to the word file(using Clipboard.SetIm age) and open another word doc, the process of writing those images migrates to the new opened document.
Can anybody suggest why this is happening?
The requirement is to write the images in the file which i have specified.The opening of another word doc should not effect the process.
Here is the code:
Can anybody suggest why this is happening?
The requirement is to write the images in the file which i have specified.The opening of another word doc should not effect the process.
Here is the code:
Code:
document.Application.Selection.TypeText("\n");
//Set text on clipboard
Clipboard.SetText(strArray[count]);
document.Application.Selection.Paste();
//Clear the clipboard
Clipboard.Clear();
document.Application.Selection.TypeText("\n");
//set image on clipboard
if (img[count] != null)
{
Clipboard.SetImage(img[count]);
document.Application.Selection.Paste();
}
document.Application.Selection.TypeParagraph();
//clear the clipboard
Clipboard.Clear();
document.Application.Selection.InsertBreak(ref pagebreak);
document.SaveAs(ref fileName, ref fileFormat,ref missing , ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing);