2011-05-11 10 views
6

मैं इंटरऑप के माध्यम से एक शब्द दस्तावेज़ खोलना चाहता हूं और शब्द प्रक्रिया में दिखाई देना चाहिए। यह काफी सीधे आगे दिखता है क्योंकि "शब्द दस्तावेज़ पर खुले फ़ंक्शन में दिखाई देने वाला पैरामीटर" होता है लेकिन शब्द पृष्ठभूमि में होता है । क्या मुझे याद आ रहीइंटरऑप के माध्यम से दस्तावेज़ खोलते समय मैं शब्द को कैसे दृश्यमान बना सकता हूं?

static void Main(string[] args) 
{ 
    Microsoft.Office.Interop.Word.Application word = null; 
    word = new Microsoft.Office.Interop.Word.Application(); 

    object inputFile = "c:\\test.docx"; 
    object confirmConversions = false; 
    object readOnly = true; 
    object visible = true; 
    object missing = Type.Missing; 

    // Open the document... 
    Microsoft.Office.Interop.Word.Document doc = null; 
    doc = word.Documents.Open(
     ref inputFile, ref confirmConversions, ref readOnly, ref missing, 
     ref missing, ref missing, ref missing, ref missing, 
     ref missing, ref missing, ref missing, ref visible, 
     ref missing, ref missing, ref missing, ref missing); 
    doc.Activate(); 

    Console.ReadKey(); 
} 
+2

यदि आप सी # 4.0 के साथ काम करते हैं तो गतिशील http://www.devx.com/dotnet/Article/42590 –

+0

का उपयोग करने पर विचार करें। यह बहुत जानकारी थी ेश्य। –

उत्तर

6

हम्म जाहिरा दोनों आवेदन और दस्तावेज दृश्यमान होना चाहिए तो समाधान पंक्ति जोड़ने के लिए है (doc.Activate से पहले()):।।

word.Visible = true; 
संबंधित मुद्दे

 संबंधित मुद्दे