Using Word.Application with Option Strick On

  • Thread starter Thread starter active
  • Start date Start date
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
 
Any reason for using strong typing for WordDoc but not for WordApp ?

Else explain a bit what is the problem you have...
 
Is I don't know how a good reason?
Guess I need a little more help

thanks for the quick reply
 
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
 
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?
 
Back
Top