Library tutorials & articles
Using OLE Automation in VB
- Introduction
- Creating the Application
- The rest of the code
Introduction
Many beginners start developing programs in VB. They hear about OLE, Automation, ActiveX, COM, etc. but they are not aware of all these technologies. If you are a beginner and you want to know more about OLE, then you should read this article. It will help you get started writing code using OLE automation capabilities.
In this program, we'll use Word object. We'll use two objects, one of the Word Application class and one of the Word Document class. We'll open the Word Application and a document, and then we'll let the user save the document via our application.
Related articles
Related discussion
-
Run-time error '91'
by converter2009 (1 replies)
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
listbox scrollbar
by Dennijr (10 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
this is a great example of how to create a new document using OLE but how can I point to and open an existing document? I want to edit the text that your example had me save.
Works great! However in your close_cmd button you must comment out the objapp.quit() because vb.net claims it's ambiguous (which is why i put the me.close in there). Also, I read somewhere that we shouldn't use the unload command--I believe it was from Rollarshade, so I didn't. Now--how would I load data into the Word document using a SQL Server?
If objDoc Is Nothing Then
MsgBox("Application not running")
Else
Me.Close()
'objApp.Quit()
objDoc = Nothing
objApp = Nothing
End If
If objDoc Is Nothing Then
Me.Close()
Else
MsgBox("Please close application first")
End If
This thread is for discussions of Using OLE Automation in VB.