Click here to Skip to main content
15,885,985 members
Home / Discussions / C#
   

C#

 
Question.NET Framework versus .NET latest? Pin
Bruce Greene7-Nov-22 8:59
Bruce Greene7-Nov-22 8:59 
AnswerRe: .NET Framework versus .NET latest? Pin
OriginalGriff7-Nov-22 9:39
mveOriginalGriff7-Nov-22 9:39 
AnswerRe: .NET Framework versus .NET latest? Pin
Mycroft Holmes7-Nov-22 10:47
professionalMycroft Holmes7-Nov-22 10:47 
GeneralRe: .NET Framework versus .NET latest? Pin
Bruce Greene7-Nov-22 11:01
Bruce Greene7-Nov-22 11:01 
AnswerRe: .NET Framework versus .NET latest? Pin
Gerry Schmitz8-Nov-22 4:57
mveGerry Schmitz8-Nov-22 4:57 
AnswerRe: .NET Framework versus .NET latest? Pin
Jacques Fournier13-Nov-22 11:10
Jacques Fournier13-Nov-22 11:10 
AnswerRe: .NET Framework versus .NET latest? Pin
jschell14-Nov-22 6:32
jschell14-Nov-22 6:32 
QuestionAnyone seen this odd Word Interop behavior? Pin
RobertSF3-Nov-22 11:00
professionalRobertSF3-Nov-22 11:00 
Using C# and Word 16.0.

C#
var wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visible = false;
Document wordDoc1 = wordApp.Documents.Add();
Document wordDoc2 = wordApp.Documents.Open(@"c:\users\robertsf\desktop\doc2.docx");
When this code executes, wordDoc1 gets clobbered, everything returning COM Exception, and wordApp.Documents contains only one object, the opened document.

C#
var wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visible = false;
Document wordDoc1 = wordApp.Documents.Add();
Document wordDoc1a = wordApp.Documents.Add();
Document wordDoc2 = wordApp.Documents.Open(@"c:\users\robertsf\desktop\doc2.docx");
When this code executes, wordDoc1 gets clobbered again, but wordDoc1a is fine, and wordApp.Documents contains two objects.

C#
var wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visible = false;
Document wordDoc2 = wordApp.Documents.Open(@"c:\users\robertsf\desktop\doc2.docx");
Document wordDoc1a = wordApp.Documents.Add();
When this code executes, however, everything is fine. wordApp.Documentscontains two objects, and each object is accessible, as expected.

I'm trying to programmatically create a new document and copy the text of a variable number of documents into it. I suppose I could open all the source documents before creating the destination document. Or I could try to create two instances of Word.Application, one for the source documents and one for the destination document, and then see if I can copy between the two instances.

Here's the MS documation.
Add: Documents.Add(Object, Object, Object, Object) Method (Microsoft.Office.Interop.Word) | Microsoft Learn[^]
Open: Documents.Open Method (Microsoft.Office.Interop.Word) | Microsoft Learn[^]

I don't see anything about one operation overwriting the other. ¯\_(ツ)_/¯
AnswerRe: Anyone seen this odd Word Interop behavior? Pin
RobertSF3-Nov-22 11:49
professionalRobertSF3-Nov-22 11:49 
QuestionAssets\Scipts\PlayerController.cs(29,6): error CS1513: } expected Unity Pin
Aryaman Madge30-Oct-22 6:51
Aryaman Madge30-Oct-22 6:51 
AnswerRe: Assets\Scipts\PlayerController.cs(29,6): error CS1513: } expected Unity Pin
Dave Kreskowiak30-Oct-22 8:24
mveDave Kreskowiak30-Oct-22 8:24 
AnswerRe: Assets\Scipts\PlayerController.cs(29,6): error CS1513: } expected Unity Pin
OriginalGriff30-Oct-22 21:03
mveOriginalGriff30-Oct-22 21:03 
Questionhow can i create a moveable object Pin
ken quirici28-Oct-22 15:24
ken quirici28-Oct-22 15:24 
AnswerRe: how can i create a moveable object Pin
OriginalGriff28-Oct-22 18:50
mveOriginalGriff28-Oct-22 18:50 
AnswerRe: how can i create a moveable object Pin
Gerry Schmitz29-Oct-22 7:05
mveGerry Schmitz29-Oct-22 7:05 
QuestionC++ Pin
Mathooanyane Khoeli28-Oct-22 10:06
Mathooanyane Khoeli28-Oct-22 10:06 
AnswerRe: C++ Pin
Dave Kreskowiak28-Oct-22 11:47
mveDave Kreskowiak28-Oct-22 11:47 
AnswerRe: C++ Pin
OriginalGriff28-Oct-22 18:49
mveOriginalGriff28-Oct-22 18:49 
QuestionC++ Pin
Mathooanyane Khoeli28-Oct-22 10:02
Mathooanyane Khoeli28-Oct-22 10:02 
AnswerRe: C++ Pin
Dave Kreskowiak28-Oct-22 11:46
mveDave Kreskowiak28-Oct-22 11:46 
AnswerRe: C++ Pin
OriginalGriff28-Oct-22 18:47
mveOriginalGriff28-Oct-22 18:47 
QuestionC# vs C++ process standard out redirection differences Pin
Member 1490333523-Oct-22 7:52
Member 1490333523-Oct-22 7:52 
AnswerRe: C# vs C++ process standard out redirection differences Pin
OriginalGriff23-Oct-22 8:16
mveOriginalGriff23-Oct-22 8:16 
QuestionLoading a Data Table form a DataGrid view but still no joy. Pin
Ozzie Mozzie22-Oct-22 23:59
Ozzie Mozzie22-Oct-22 23:59 
AnswerRe: Loading a Data Table form a DataGrid view but still no joy. Pin
OriginalGriff23-Oct-22 0:51
mveOriginalGriff23-Oct-22 0:51 

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.