Results 1 to 3 of 3

Thread: Converting code to support late binding

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    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

    Parksie

  2. #2
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    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?
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  3. #3
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    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
  •  



Click Here to Expand Forum to Full Width