.net 4.0 - Error when creating an instance of Word in VB.net -


i getting error when run app in vs 2010 (it works fine in vs 2008)

private sub generateinvoice()

dim emptyobject object = system.reflection.missing.value  dim wordapp new word.application wordapp.visible = true  dim invoicedoc new word.document invoicedoc = wordapp.documents.add(invoicepath, emptyobject, emptyobject, emptyobject)  dim totalfields integer = 0  each mergefield word.field in invoicedoc.fields 

the error occurs @ each line

"object reference not set instance of object."

am missing here?

maybe invoicepath used in instance run via vs2010 invalid , call documents.add fails?

are running both vs2010 , vs2008 on same machine? , invoicepath set exact same path in both instances?


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -