Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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 HallJust trying

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.Saveor
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

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

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

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

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

![]() |
![]() |
![]() |

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