|
-
Sep 29th, 2008, 06:03 AM
#1
Thread Starter
Fanatic Member
Converting code to support late binding
I am using the following code which makes use of early binding :
Code:
Dim oDoc As Microsoft.Office.Interop.Word.Document
oDoc = DirectCast(axFramerControl1.ActiveDocument, Microsoft.Office.Interop.Word.Document)
oDoc.ActiveWindow.Selection.WholeStory()
The problem is that I would like to dump my reference and use late binding instead.
Can anyone convert this please ?
Thanks in Advance
-
Sep 29th, 2008, 07:31 AM
#2
Re: Converting code to support late binding
Why on earth would you want to use late binding? I've never seen a convincing reason and all it does is slow down your program.
Aside from that, I'm trying to figure out what you're trying to accomplish as to how to apply late-binding. What's wrong with your above code? What isn't it doing for you?
-
Sep 29th, 2008, 07:50 AM
#3
Frenzied Member
Re: Converting code to support late binding
Well turn Option Strict Off and declare oDoc as Object.
I agree with Jenner though, late binding should be avoided whenever possible. In this case, it provides no advantage so it should not be used, since the only visible effect would be a performance reduction.
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
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
|