Open Word doc bug

I added the MS Automation plugin and restarted Xojo. Then used this recommended code.

dim word as new WordApplication
dim doc as WordDocument
doc = word.Documents.open(“path and name to my word doc”)

It compiles but when I run it stops on the “open” with a little bug symbol but I don’t see any message.
Run time error?

How do I debug?

Hover the mouse over the “bug” icon to see the exception. Or click the “Exception” entry in the variables list. Or press Resume to see an exception dialog.

BTW, I’ll be covering Debugging in next week’s webinar on Jan 14th.

Hi Tim,

When writing this in Word, the WordApplication needs to be visible.

Try this:

Dim word as new WordApplication Dim doc as WordDocument doc = word.Documents.Open("c:\\test\\aDocument.docx") word.Visible = True

Happy to help :slight_smile: