I'm having trouble figuring out how to work with word ranges. I have picture files that I am adding to a word file, but I can't figure out how to add text and tables in between the pictures. The structure I want is this: Text, table, picture. Then repeat.
However, when I add text or tables, they all area added after the four pictures, which stay at the top of the file. I've been reading and I've figured out I need to use ranges to specify where you want to place the tables/text, but all the resources I found only show how to add at the top of the page.
Tables: http://msdn.microsoft.com/en-us/library/w1702h4a.aspx Text: http://msdn.microsoft.com/en-us/library/6b9478cs.aspx
This is how I add pictures:
Word.Application wdApp = new Word.Application();
wdApp.Visible = true;
Document doc = wdApp.Documents.Add();
foreach (var category in type){
// add table/text
doc.Application.Selection.InlineShapes.AddPicture(@path + "\\" + category + "_" + DateTime.Now.ToString(datePatt) + ".jpg");
}
I expected to be able to add my text/table before the picture, but it seems I have to specify ranges in the file. How can I do this?