Office Automation and late binding

S

scorpion53061

I am sorry for this but I am not getting an answer elsewhere so I thought I
would try here.

It seems the safer way to go prior to deployment is to change my early
binding to late binding to prevent lots of issues occuring, especially those
on Office versions other than mine. (I have 2003). such as

Public WordApp As Object = CreateObject("Word.Application")
Public oDoc As Object = CreateObject("Word.Document")

instead of

'Public WordApp As New Word.Application
'Public oDoc As Word.Document


This occured because late last night a client reported this error

http://support.microsoft.com/default.aspx?scid=kb;en-us;292744

Does this mean I can remove the references to the Word object library and
such?

I have run into one issue concerning this.

When I tried to do

Public dlg as Object = Creatobject("Word.Dialog")

instead of

'Public dlg As Word.Dialog

it says it cannot create the active x component. How shall I use late
binding with this?

I much appreciate your answers
 
A

Armin Zingler

scorpion53061 said:
I have run into one issue concerning this.

When I tried to do

Public dlg as Object = Creatobject("Word.Dialog")

instead of

'Public dlg As Word.Dialog

it says it cannot create the active x component. How shall I use
late binding with this?

A Word.Dialog is not createable this way, just like you also can't write

dlg = NEW Word.Dialog

You must get the Dialog object from any property of the creatable objects,
like Word.Application. It's Dialogs property returns Dialog objects.
 
S

scorpion53061

You must get the Dialog object from any property of the creatable objects,
like Word.Application. It's Dialogs property returns Dialog objects.


Armin,

In your opinion is it okay to mix early binding and late binding in the same
application?
 
A

Armin Zingler

scorpion53061 said:
Armin,

In your opinion is it okay to mix early binding and late binding in
the same application?


I don't know. Probably I won't.

But, (why) do you think it would t solve the problem?
 
S

scorpion53061

But, (why) do you think it would t solve the problem?

It did solve the problem.

I was wondering because I have other objects that are taking so long to load
with late binding but were working okay for the client that I didnt want to
switch them over to late binding if I didnt have to.
 
A

Armin Zingler

scorpion53061 said:
It did solve the problem.


??

Your problem was that Creatobject("Word.Dialog") does not work. Now, using
early binding,

New Word.Dialog

works? I don't think so.
 
S

scorpion53061

Your problem was that Creatobject("Word.Dialog") does not work. Now, using
early binding,

New Word.Dialog

works? I don't think so.

Armin,

You are jumping to conclusions or something. I want to keep early binding
for other unrelated database issues.

You should relax a little bit.
 
A

Armin Zingler

scorpion53061 said:
Armin,

You are jumping to conclusions or something. I want to keep early
binding for other unrelated database issues.

You should relax a little bit.

Me? I relax from time to time.


<you>
I have run into one issue concerning this.

When I tried to do

Public dlg as Object = Creatobject("Word.Dialog")

instead of

'Public dlg As Word.Dialog

it says it cannot create the active x component. How shall I use late
binding with this?
</you>

<me>
A Word.Dialog is not createable this way, just like you also can't write

dlg = NEW Word.Dialog
</me>

<you>
is it okay to mix early binding and late binding in the same
application
</you>

I thought you were referring to my answer (referring to your question
concerning Creatobject("Word.Dialog")). That's why I thought you mean that
mixing early and late binding could solve the problem. You wrote that it
did. As I could (and can) not imagine that it really did, I asked again. If
you were not referring to the initial problem, _you_ have been jumping, not
me. :)
 
S

scorpion53061

I thought you were referring to my answer (referring to your question
concerning Creatobject("Word.Dialog")). That's why I thought you mean that
mixing early and late binding could solve the problem. You wrote that it
did. As I could (and can) not imagine that it really did, I asked again. If
you were not referring to the initial problem, _you_ have been jumping, not
me. :)

Armin,

No I said "jumping to conclusions". Your suggestion was fine for the word
dialog problem. I simply assigned it to the objects event though no
intellisense would help me. There are other issues involved with late
binding, automation and database handling.

I try to keep other issues that i am dealing with out of the question at
hand. My goal is to prevent confusion. But in this case it muddled things
more.

Anyway plesae look in on the thread
Re: removing non traditional text

I would value your input.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top