sto creando un programma in C# per aprire un documento di Word
C# aprire un documento word
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
sto creando un programma in C# per aprire un documento di Word
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tuhin PaulRank #7 · 71.9K reputationPosted Nov 9, 2024, 1:24 PM EST
using System; using Microsoft.Office.Interop.Word; namespace WordOpener { class Program { static void Main(string[] args) { Application wordApp = new Application(); wordApp.Visible = true; string filePath = @"C:\path\to\your\document.docx"; Document doc = wordApp.Documents.Open(filePath); Console.WriteLine("Document opened successfully."); } } }false, Word will open in the background.you can use the Microsoft.Office.Interop.Word library, which allows you to interact with Microsoft Word through code.