Microsoft.Office.interop.word problems

I may having issues with the microsoft.office.interop.word.

Dim somewordAs Microsoft.Office.Interop.Word.Application

Dim somedocAs Microsoft.Office.Interop.Word.Document

someword.Application.Activate()

somedoc.Words.Application.Run("sorting_macro")

The issue is that when I run it i get an error that says the "someword.app.activate" object reference not set to an instance of the object

Another issue is that when i run it i can also get an error that says: microsoft.office.interop.word_document failed

Does anyone know how to make vb.net run a macro in MS word 2k3?

any help would be grand!!!!!!!!

thanks in advance for the help!

[1009 byte] By [cmwith] at [2007-12-22]
# 1
Try this:

Imports Microsoft.Office.Interop

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim app As New Word.Application

app.Visible = True

app.Activate()

app.Run("sorting_macro")

End Sub

End Class

nobugz at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2
Thank you very much that worked perfect
cmwith at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified