Click here to Skip to main content
15,893,486 members
Home / Discussions / C#
   

C#

 
QuestionRe: run sql script in C# new Pin
jojoba201130-Nov-11 1:02
jojoba201130-Nov-11 1:02 
AnswerRe: run sql script in C# new PinPopular
Pete O'Hanlon30-Nov-11 1:07
mvePete O'Hanlon30-Nov-11 1:07 
GeneralRe: run sql script in C# new Pin
jojoba201130-Nov-11 1:09
jojoba201130-Nov-11 1:09 
GeneralRe: run sql script in C# new Pin
Pete O'Hanlon30-Nov-11 1:14
mvePete O'Hanlon30-Nov-11 1:14 
QuestionRe: run sql script in C# new Pin
jojoba201130-Nov-11 17:54
jojoba201130-Nov-11 17:54 
AnswerRe: run sql script in C# new Pin
Dave Kreskowiak1-Dec-11 4:11
mveDave Kreskowiak1-Dec-11 4:11 
AnswerRe: run sql script in C# Pin
jschell30-Nov-11 10:16
jschell30-Nov-11 10:16 
QuestionMicrosoft Interop Word Winforms issue on CITRIX Pin
spankyleo12330-Nov-11 0:00
spankyleo12330-Nov-11 0:00 
Hi,

I have a developed a winforms app with c# as the language. Integrated a word object model (Microsoft.Interop.Word 12.0 library) to fill in a word document from a word template using bookmarks. The application opens the word document on button click. This workd fine on my local machine, but when installed on a CITRIX server it is giving an error on button click (Null reference exception). The word doc opens fine when the button is clicked once, but when i close the word doc and re-click on the same button its throwing an exception.

C#
private void btn_Click(object sender, EventArgs e)
 {      

oWordApp = new Word.Application();
           oWordDoc = new Word.Document();

object missing = System.Reflection.Missing.Value;
            object oTemplate =  "C:\\Program Files\\MyTemplate.dot";
oWordDoc = oWordApp.Documents.Add(ref oTemplate, ref missing, ref missing, ref missing);   
 object oBookMark = "Date";
            oWordDoc.Bookmarks.get_Item(ref oBookMark).Range.Text = DateTime.Now.ToShortDateString();
oWordApp.Application.Visible = true;
            oWordApp.WindowState = Word.WdWindowState.wdWindowStateNormal;
}


Does any one know how to resolve this issue?

modified 30-Nov-11 6:32am.

AnswerRe: Microsoft Interop Word Winforms issue on CITRIX Pin
Richard MacCutchan30-Nov-11 3:11
mveRichard MacCutchan30-Nov-11 3:11 
GeneralRe: Microsoft Interop Word Winforms issue on CITRIX Pin
spankyleo12330-Nov-11 23:12
spankyleo12330-Nov-11 23:12 
GeneralRe: Microsoft Interop Word Winforms issue on CITRIX Pin
Richard MacCutchan30-Nov-11 23:47
mveRichard MacCutchan30-Nov-11 23:47 
QuestionImport a .reg file to a remote machine's registry Pin
AndieDu29-Nov-11 19:00
AndieDu29-Nov-11 19:00 
SuggestionRe: Import a .reg file to a remote machine's registry Pin
Reiss29-Nov-11 22:20
professionalReiss29-Nov-11 22:20 
GeneralRe: Import a .reg file to a remote machine's registry Pin
AndieDu30-Nov-11 12:16
AndieDu30-Nov-11 12:16 
QuestionMulti-Connection Problem Pin
kornkimhour29-Nov-11 15:50
kornkimhour29-Nov-11 15:50 
AnswerRe: Multi-Connection Problem Pin
PIEBALDconsult29-Nov-11 17:50
mvePIEBALDconsult29-Nov-11 17:50 
Questionip iterator code challenge Pin
acecase29-Nov-11 9:41
acecase29-Nov-11 9:41 
AnswerRe: ip iterator code challenge Pin
Ian Shlasko29-Nov-11 10:04
Ian Shlasko29-Nov-11 10:04 
GeneralRe: ip iterator code challenge Pin
acecase29-Nov-11 14:16
acecase29-Nov-11 14:16 
GeneralRe: ip iterator code challenge Pin
Ian Shlasko29-Nov-11 15:04
Ian Shlasko29-Nov-11 15:04 
GeneralRe: ip iterator code challenge Pin
acecase29-Nov-11 15:49
acecase29-Nov-11 15:49 
GeneralRe: ip iterator code challenge Pin
Ian Shlasko29-Nov-11 16:12
Ian Shlasko29-Nov-11 16:12 
GeneralRe: ip iterator code challenge Pin
acecase29-Nov-11 16:46
acecase29-Nov-11 16:46 
GeneralRe: ip iterator code challenge Pin
Ian Shlasko29-Nov-11 17:00
Ian Shlasko29-Nov-11 17:00 
GeneralRe: ip iterator code challenge Pin
acecase29-Nov-11 17:02
acecase29-Nov-11 17:02 

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.