Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Word Newsgroups
Word VBA
C# to concatenate word documents; problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Cindy M., post: 5871417"] Hi =?Utf-8?B?Z3JldGNob2c=?=, Which version of Word are you targeting? And which version are you testing against on your development machine? Any code manipulating Office should be in Try...Catch blocks. The COM application may otherwise not return error information to the managed code and will fail silently. I recommend using a MessageBox.show(ex.Message) in the Catch block so that you see the message immediately. From the look of it, the optimal place to put a break point would be in the MsWord class, fairly close to the beginning (Merge, maybe). Once it hits the break point, use F11 to step through. Check the values of the variables being passed into the class, as you go, to make sure they contain the values you expect. (For example, if the Length of filesToMerge is 0 you've got a problem.) Also, for debugging purposes, make the Word Application instance visible. This can give you an idea about what's happening as you step through. At the end, since you're quitting the Word application, you may want to Close the wordDocument before assigning it "null". Otherwise, you risk creating a memory leak. The links Jean Guy gave you aren't necessarily the best places to ask this. The VSTO forum technically doesn't support WinForms, Console and ASP.NET applications, as VSTO is a particular technology that runs within the Office application interface. The folks in the C# forums aren't really "into" Office automation. The most appropriate place to go with this would be the office.developer.automation newsgroup, although you may not find much more help there. There just aren't a lot of C# people with in-depth experience sharing their knowledge about working with Office apps. [URL]Http://www.microsoft.com/office/community/en-us/default.mspx?[/URL] dg=microsoft.public.office.developer.automation&lang=en&cr=US I can very much recommend two books if you're going to be doing much with Office and C#: .NET Development for Office by Andrew Whitechapel Visual Studio Tools for Office Using C# by Eric Carter and Eric Lippert The first is a "must have" for you. Even though you (currently) aren't using VSTO, the second book provides a lot of information about working with the Office object models. Cindy Meister INTER-Solutions, Switzerland [URL]http://homepage.swissonline.ch/cindymeister[/URL] (last update Jun 17 2005) [URL]http://www.word.mvps.org[/URL] This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Word Newsgroups
Word VBA
C# to concatenate word documents; problem
Top