Using Word.Application with Option Strick On

A

active

How do you do things like the following with

Option Strict On

Dim ColSuggestions As Word.SpellingSuggestions

Dim WordApp As Object = New Word.Application

Dim WordDoc As New Word.Document

WordDoc = WordApp.Documents.Add(Template:="Normal.dot", NewTemplate:=False)

....snip

WordDoc.Range.Text = someText

.....snip

colSuggestions = WordApp.GetSpellingSuggestions(colSpellErrors.Item(1).Text)



Thanks for any suggestions
 
P

Patrice

Any reason for using strong typing for WordDoc but not for WordApp ?

Else explain a bit what is the problem you have...
 
A

active

Is I don't know how a good reason?
Guess I need a little more help

thanks for the quick reply
 
A

active

After I replied I looked at the syntax and noticed the difference between
WordDoc and WordApp (because of your question) and removed the as object and
that appears to have fixed it.

Thanks
 
A

aaron.kempf

I would reccomend using VBA instead of trying to use .NET to move VBA
object model.

I mean seriously here.

Why would you possibly use .NET to push office docs?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top