B
Bob
I got a bit of code that launches Word and opens a file, as follows
Private sub OpenWord(Byval Fname as string)
Dim MyWord As New Microsoft.Office.Interop.Word.Application
Dim doc As Microsoft.Office.Interop.Word.Document
doc = MyWord.Documents.Open(Fname)
doc.activate()
MyWord.visible = true
end sub
When my project properties has Option strict On (which is what I want) I get
a blue underline in the IDE under the variable Fname (string type) and it
tells me that the string type can not be converted to object implicitly. I
do look at the intellisense of the Open method and I see the parameter
filename is of type object.
What do I need to do to be able to use my passed parameter Fname in the Open
method?
Thanks for any help
Bob
Private sub OpenWord(Byval Fname as string)
Dim MyWord As New Microsoft.Office.Interop.Word.Application
Dim doc As Microsoft.Office.Interop.Word.Document
doc = MyWord.Documents.Open(Fname)
doc.activate()
MyWord.visible = true
end sub
When my project properties has Option strict On (which is what I want) I get
a blue underline in the IDE under the variable Fname (string type) and it
tells me that the string type can not be converted to object implicitly. I
do look at the intellisense of the Open method and I see the parameter
filename is of type object.
What do I need to do to be able to use my passed parameter Fname in the Open
method?
Thanks for any help
Bob