Computing.Net > Forums > Programming > OLE linling in VB4

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

OLE linling in VB4

Reply to Message Icon

Name: jackfrost5556
Date: March 1, 2005 at 11:32:02 Pacific
OS: 98SE
CPU/Ram: 166/64
Comment:

Hello everyone.
Got to the level where I'm dealing with imbedding and linking using OLE. With word, and or word pad, for example I can do either.
Link or imbed. I've written(created)some Files using html,saved with the .htm extension. They imbed fine but won't link. Error box with can't display shows. Can't seem to find a work around, in help and the training manual doesn't show any solution.
Any input would be helpful...With imbedding editing is history, and that's what I'm trying to work thru..
Thanks in advance Jack Hall

Just trying



Sponsored Link
Ads by Google

Response Number 1
Name: StuartS
Date: March 1, 2005 at 15:23:32 Pacific
Reply:

You create a Word Object using the following code.

Set MyObject = CreateObject("Word.Application")

You then use the properties and methods of MyObject to load and maipulate a word document.

e.g

MyObject.Documents.Add
MyObject.Selection.InsertFile FileName:=FileName
MyObject.Documents.Save

or

MyObject.ActiveDocument.SaveAs FileName:=FileName

There is plenty of information in the Help files giving all the options.

You need to ensure that you have a reference to the MS Word Object Libary in your project.


Stuart


0

Response Number 2
Name: jackfrost5556
Date: March 2, 2005 at 11:38:59 Pacific
Reply:

Thanks Stuart. Sorry for dumb, but a lot of this is new to me. Could you clarify where I'm supposed to write this code. To be frank, help is awsumely detailed, but confusing sometimes to a beginner..
As a friend said, seems sometimes like a vertical learning curve. I've learned a lot, but....

Just trying


0

Response Number 3
Name: StuartS
Date: March 2, 2005 at 13:03:51 Pacific
Reply:

You can put the code anywhere you like. In the form load event so when a form loads it automatically loads and displays the the document.

You could also put it in a command button click event so the document loads when you click a button.

Linking objects in VB can be complicated. The only way to do it is to jump in and try it and see what works. The worst thing that can happen is that you will crash the computer.

It is a very powerful tool and once you have mastered the basic principles it is amazing what you can do. You can also use the same principles to manipulate and Excel Spreadsheet.

Good Luck

Stuart


0

Response Number 4
Name: jackfrost5556
Date: March 6, 2005 at 12:20:26 Pacific
Reply:

Thanks again. I might be getting ahead of myself. Tried a "class module", but what do I know. Lot of work ahead. Your input is really helpful. Jack

Just trying


0

Response Number 5
Name: StuartS
Date: March 6, 2005 at 12:48:19 Pacific
Reply:

You may be getting ahead of yourself with class modules.

Class modules are used for creating Active X X modules, of COM (Common Object Module) with the DLL extension. Another powerful tool when you have mastered them.

Linking A word document is using a COM application, but one supplied by Microsoft with MS Office.

Stuart


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: OLE linling in VB4

Code help in VB4 www.computing.net/answers/programming/code-help-in-vb4/12170.html

imbedding and linking OLE in VB4 www.computing.net/answers/programming/imbedding-and-linking-ole-in-vb4/12642.html

OLE questions www.computing.net/answers/programming/ole-questions/7009.html