|
-
January 30th, 2003, 10:37 AM
#1
Problem when using Option Explicit ON
Hi
I want to open a word document using vb net. All works find when i'm not usins Option Explicit on and
Option Strict On.
here's my code
Dim objwrd As Object
objwrd = CreateObject("Word.application")
objwrd.application.Visible = True
objwrd.Documents.open("E:\VbNet\test.doc")
The last two lines are in error if these two option are ON . Why? Is anyboby can help me with this?
Thank you
Alexandre
-
January 30th, 2003, 10:42 AM
#2
Option Strict means you HAVE to define every variable as a specific date type (or object) so this should work
Dim objWord as Word.Application 'Specific Object Type
INSTEAD of
Dim objWord as Object ' Generic Object
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|