Click here to Skip to main content
15,886,362 members
Home / Discussions / C#
   

C#

 
GeneralRe: Multiple Field Sorting C# Pin
riced18-Jul-09 0:11
riced18-Jul-09 0:11 
GeneralRe: Multiple Field Sorting C# Pin
dsrao18-Jul-09 9:13
dsrao18-Jul-09 9:13 
QuestionProcess.workingset Pin
hpydir17-Jul-09 14:53
hpydir17-Jul-09 14:53 
AnswerRe: Process.workingset Pin
Luc Pattyn17-Jul-09 15:03
sitebuilderLuc Pattyn17-Jul-09 15:03 
Questionhelp Pin
unlucky_dreamer17-Jul-09 12:45
unlucky_dreamer17-Jul-09 12:45 
AnswerRe: help Pin
DaveyM6917-Jul-09 13:20
professionalDaveyM6917-Jul-09 13:20 
GeneralRe: help Pin
Michael Schubert17-Jul-09 22:06
Michael Schubert17-Jul-09 22:06 
QuestionMS Word Automation - Combining word documents Pin
venadder17-Jul-09 11:25
venadder17-Jul-09 11:25 
Hi,
I am working on a MS Word Automation project using VS2008 and Office 2003 in c# language. I have a One Page Word template which have bookmarks in table cells. These bookmarks are placeholders where specific information is put in from database using c#. I generate say 10 documents based on the template and save them as seperate file. What I would like is to have a 10 page single document. I can use selection.insertfile to create this document. When I do this, all the formatting goes bersek.
Basically what i do is:


Word.Application app = new Word.Application( );
Word._Document wordDocument = app.Documents.Add(

                                    ref originalTemplate

                                  , ref oMissing

                                  , ref oMissing

                                  , ref oMissing);


      Word.Selection selection = app.Selection;

      

      int documentCount = MyGeneratedFiles.Length;
      int breakStop = 0;

      foreach (string file in MyGeneratedFiles)

      {

        breakStop++;

        // Insert the files to our template

        selection.InsertFile(

                                file

                                , ref oMissing

                                , ref oMissing
                                , ref oMissing

                                , ref oMissing);







        try

        {

          if (breakStop != documentCount)

            selection.InsertBreak(ref pageBreak);

        }

        catch (Exception ex) { }

      }

      wordDocument = null;

      app.Visible = true;



This works as far as combining all documents is concerned. But the formattign goes crazy and there are no clearly defined pageBreaks. Is there a better way to combine multiple one page documents into one multi-page single document? I have been stuck on this for a while, any help will be much appreciated.

Thank you


QuestionDelegates - I don't Get It Pin
eddieangel17-Jul-09 7:52
eddieangel17-Jul-09 7:52 
AnswerRe: Delegates - I don't Get It Pin
harold aptroot17-Jul-09 8:14
harold aptroot17-Jul-09 8:14 
AnswerRe: Delegates - I don't Get It Pin
CodingYoshi17-Jul-09 8:20
CodingYoshi17-Jul-09 8:20 
GeneralRe: Delegates - I don't Get It Pin
eddieangel17-Jul-09 8:35
eddieangel17-Jul-09 8:35 
GeneralRe: Delegates - I don't Get It Pin
DaveyM6917-Jul-09 10:47
professionalDaveyM6917-Jul-09 10:47 
GeneralRe: Delegates - I don't Get It Pin
eddieangel17-Jul-09 11:00
eddieangel17-Jul-09 11:00 
GeneralRe: Delegates - I don't Get It Pin
DaveyM6917-Jul-09 11:26
professionalDaveyM6917-Jul-09 11:26 
GeneralRe: Delegates - I don't Get It Pin
DaveyM6917-Jul-09 11:39
professionalDaveyM6917-Jul-09 11:39 
AnswerRe: Delegates - I don't Get It Pin
Luc Pattyn17-Jul-09 10:13
sitebuilderLuc Pattyn17-Jul-09 10:13 
GeneralRe: Delegates - I don't Get It Pin
Baeltazor17-Jul-09 22:28
Baeltazor17-Jul-09 22:28 
QuestionCrystalReports Pin
CodingYoshi17-Jul-09 7:06
CodingYoshi17-Jul-09 7:06 
AnswerRe: CrystalReports Pin
Adam R Harris17-Jul-09 9:20
Adam R Harris17-Jul-09 9:20 
GeneralRe: CrystalReports Pin
Adam R Harris17-Jul-09 10:41
Adam R Harris17-Jul-09 10:41 
GeneralRe: CrystalReports Pin
CodingYoshi17-Jul-09 10:54
CodingYoshi17-Jul-09 10:54 
QuestionCommon components in C# and .net? Pin
saxisa17-Jul-09 7:01
saxisa17-Jul-09 7:01 
QuestionNTLM Authentication in C# Pin
joana.simoes17-Jul-09 5:39
joana.simoes17-Jul-09 5:39 
AnswerRe: NTLM Authentication in C# Pin
Adam R Harris17-Jul-09 9:25
Adam R Harris17-Jul-09 9:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.