Writing images to word file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • talk2pk
    New Member
    • Aug 2008
    • 5

    #1

    Writing images to word file

    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:
    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);
    Last edited by Curtis Rutland; Sep 24 '08, 02:09 PM. Reason: Added Code Tags - Please use the # button
Working...