473,325 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Writing images to word file

When i am writing the images to the word file(using Clipboard.SetImage) 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:
Expand|Select|Wrap|Line Numbers
  1. document.Application.Selection.TypeText("\n");
  2.                     //Set text on clipboard
  3.                     Clipboard.SetText(strArray[count]);
  4.  
  5.                     document.Application.Selection.Paste();
  6.                     //Clear the clipboard
  7.                     Clipboard.Clear();
  8.  
  9.                     document.Application.Selection.TypeText("\n");
  10.  
  11.                     //set image on clipboard
  12.                     if (img[count] != null)
  13.                     {
  14.                         Clipboard.SetImage(img[count]);
  15.                         document.Application.Selection.Paste();
  16.                     }
  17.  
  18.                     document.Application.Selection.TypeParagraph();
  19.                     //clear the clipboard
  20.                     Clipboard.Clear();
  21.                     document.Application.Selection.InsertBreak(ref pagebreak);
  22.  
  23.  
  24.                  document.SaveAs(ref fileName, ref fileFormat,ref missing , ref missing, ref missing, ref missing,
  25.                     ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
  26.                     ref missing, ref missing);
Sep 24 '08 #1
0 1238

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Guillaume Durand | last post by:
Hi, I transform XML data in an OutputStream which is open as a word document. All works fine excepted the images defined in the xsl file which are html links (src="images/image1.jpg"). So, when...
2
by: gerard.buskermolen | last post by:
Hello world, I have an ASP.NET application that returns HTML to the browser that should be read by MS Word. To do this I set Response.ContentType = ContentType.Word and render the HTML. The...
0
by: gerard.buskermolen | last post by:
Hello world, I have an ASP.NET application that returns HTML to the browser that should be read by MS Word. To do this I set Response.ContentType = ContentType.Word...
2
by: Yaseen D M | last post by:
I have aspx page which contains some gif, jpg and png images. PNG image is generated dynamically. This file is basically a graph image. The problem i am facing in exporting these images to word,...
1
by: mohan21_kumar | last post by:
Hi, How to Save images in ms word file when it is downloaded from asp.net application. I have used the following code to convert the html page into ms word file. but i'm not able to save the...
4
by: jackpod | last post by:
Hi, I have been trying to write an image to a database table BLOB field in MySQL but when I try to retrieve the image to display it, it shows as being empty. Are there any special considerations I...
9
by: jerry.upstatenyguy | last post by:
I am really stuck on this. I am trying to write a string array containing a "word" and a "definition" to a class called Entry. Ultimately this will end up in another class called dictionary. No,...
11
by: sandeepkedlaya | last post by:
Hello, I need to copy images from a folder and copy to a word document. I have done as follows.. but It copies only last image. Can any one of you help me in this.. Private Sub Page_Load(ByVal...
2
by: Simon Wigzell | last post by:
I have inherited a database driven website that comes with a table of image links. The images are scattered all of the internet and there are thousands of them. I would like to write an asp script...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.