473,383 Members | 1,737 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,383 software developers and data experts.

Word interop C# Generating Table and Generate sub rows

shahjapan
Hello,

I am creating a Office Word 2003 Addin.
in which I am using Mail Merge through C# coding.

I required to generate a Temporary Data Source which contains a complex structure.

Can anybody tell me how to create sub rows in a Cell of a table ?

I tried to insert sub rows in a cell of table through C# but it adds rows to entire table,

Then I tried to merge other coulmns other then the required Cell but its too complex as I may have several Cells already merged too.

I just wanna know how to insert sub rows in a Cell of existing table's row's Cell.

Any help will be appreciated.

Regards,
Japan Shah
Sep 10 '07 #1
2 4014
Frinavale
9,735 Expert Mod 8TB
Hello,

I am creating a Office Word 2003 Addin.
in which I am using Mail Merge through C# coding.

I required to generate a Temporary Data Source which contains a complex structure.

Can anybody tell me how to create sub rows in a Cell of a table ?

I tried to insert sub rows in a cell of table through C# but it adds rows to entire table,

Then I tried to merge other coulmns other then the required Cell but its too complex as I may have several Cells already merged too.

I just wanna know how to insert sub rows in a Cell of existing table's row's Cell.

Any help will be appreciated.

Regards,
Japan Shah
I'm not sure what you mean by sub rows.
Could you explain this a bit more.

What I think you're going to want to do is create a table for your "sub rows"...call it SubTable. Then you're going to want to add rows to your SubTable. Once you're done adding rows to this table, you're going to want to add it to your main table within the cell you want to add it to.

Hope this helps.

-Frinny
Sep 10 '07 #2
I mean I want to split some of cells vertically,
I tried it but using split we can not get the Row Level Operation so we can not get the Cell Address.

but I think without split we can not do it.

I tried
Expand|Select|Wrap|Line Numbers
  1.  
  2. object NumRows = many2manyData.Length; 
  3. object NumColumns = 1;
  4. currentRow.Cells[current_column].Split(ref NumRows,ref NumColumns);
  5.  
The main problem is how to get the rowIndex and columnIndex of splited Cell.

but after that I am no longer able to get the address of the new splited cell. becoz following generate Exception.

Expand|Select|Wrap|Line Numbers
  1. currentRow.Cells[current_column].Next.Range.Text = "hi";
  2.  
I'm not sure what you mean by sub rows.
Could you explain this a bit more.

What I think you're going to want to do is create a table for your "sub rows"...call it SubTable. Then you're going to want to add rows to your SubTable. Once you're done adding rows to this table, you're going to want to add it to your main table within the cell you want to add it to.

Hope this helps.

-Frinny
Sep 11 '07 #3

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

Similar topics

14
by: Philippe C. Martin | last post by:
Hi, I wish to use an easy way to generate reports from wxPython and feel wxHtmlEasyPrinting could be a good solution. I now need to generate the HTML wxHtmlEasyPrinting can print: I need to...
4
by: Mark | last post by:
BEGINNER QUESTION I have a table which has a compound primary key consisting of two columns. One of these columns is a foreign key which is generated in another table by an identity. I want...
9
by: YONETANI Tomokazu | last post by:
Hi. You can use the following SQL to construct rows with column names on the fly, rather than from an existing table like sysibm.sysdummy1: SELECT * FROM TABLE ( VALUES (0, 1, 2), (3, 4, 5), (6,...
8
by: sudha | last post by:
Hi, To open a word doc from c#, i use the following code : Word.ApplicationClass WordApp = new Word.ApplicationClass (); // give any file name of your choice. object fileName =...
5
by: Webbyz | last post by:
Another problem that I am having is that I want to make some type of word or text document that is populated with data from my datagrid. Is this possable? And how do I keep ot formatted? I.E. I...
7
by: Dave | last post by:
Apologies for the newbie question. I have created a vb.net program for my company that is designed to work with Word Templates (about forty of them that we commonly use) that are selected by the...
1
by: xavier vazquez | last post by:
I have a problem with a program that does not working properly...when the program run is suppose to generate a cross word puzzle , when the outcome show the letter of the words overlap one intop of...
2
by: Alan T | last post by:
private Interop.Word.Application _wordApp; What is the differences betwenn _wordApp.Quit(...) and _wordApp.Application.Quit(...) ?
1
by: Bhrionn | last post by:
Hello World, I am working on implementing a build for my companies application. The scenario implemeted is producing the error: ‘Class does not support automation or does not support expected...
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.