473,698 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

insert images in word with c#

4 New Member
hi, i'm inserting some images in a word document, and i want to separate this images with a carriage return, but when i insert new lines they are inserted at the end of document. i want to insert: image, new line, image, new line, ...

here's the code:
Expand|Select|Wrap|Line Numbers
  1. ...
  2. for(int i=0; i<12; i++)
  3. {
  4.    Word.InlineShape shape = wDoc.InlineShapes.AddPicture(@"D:\image" + i.ToString() + ".jpg", ref missing, ref missing, ref missing);
  5.    shape.AlternativeText = "image: " + i.ToString();
  6.  
  7.    Word.Range range = wDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
  8.    range.Text = Environment.NewLine;
  9. }
  10.  
Apr 11 '07 #1
0 1862

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

Similar topics

2
9484
by: Pamel | last post by:
I currently have a page that has 6 images in a row. Using javascript, when the mouse goes over one of the images, a word is placed below the images. Each image has a different word. I am trying to change this to happen through CSS. I think I might be able to use a hover technique similar to the one used here: http://css.maxdesign.com.au/listamatic2/horizontal04.htm Focusing specifically on this line:
2
3176
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 browser (IE6.0) shows a dialog box which enables the user to Open the HTML in Word or save it to disk. So far so good.
0
1222
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 Response.AddHeader("Content-Disposition", "Report.doc") and render the HTML.
1
5685
by: JSL | last post by:
How to insert images into a Microsoft Word document using VB.NET?? my code: Public Function PictureReport() (it doesn't work!!!) On Error Resume Next Dim oDoc As Word.Document Dim range As Word.Range
11
2600
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 sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Response.Buffer = True Dim DirPath As String DirPath = "D:\ASPDotNet\images\" Dim FileName As String
0
1611
by: avisekrishi | last post by:
Hi , I have 100 image . I need to follow the following steps 1. Open a word document 2. Click on Insert -> Picture -> File and then open the image file 3. The Image gets opened in Word.
4
5106
bugboy
by: bugboy | last post by:
I'm inserting a new word into table 'w' and a definition into table 'c' which are linked in table 's' which is the relation table for the many to many relationship between 'w' and 'c'. I've been passed 2 variables from a form; $word and $def and i'm inserting them ok but i'm having trouble getting and passing on their ID's in order to insert them into the relation table 's' I've checked every query and they all work individually, so i...
3
1770
by: tesa | last post by:
Thanks for the help early this morning! The one problem I can not figure out still is how to swap the images. I have the images in an array. is the image to start with.... then as the player chooses an incorrect letter it should swap an image. When it gets to the last image the player looses. The game is working great it is just not showing the images and I feel with so many changes I have the code messed up and I am not seeing it. Any...
1
3150
by: Pedro Rosas Silva | last post by:
Hi everyone, Is anybody aware of a way how to insert an image in a WordML document programmatically, through C#? I have a C# application that loads into memory a WordML document (XmlDocument). The document is tagged in certain places so that the C# application can search for those tags (using the System.Xml namepace) and fill
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7728
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2330
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.