Way to Embed Microsoft Word in Visual Basic 6

Posted on 2006-05-16
Last Modified: 2013-11-25
Is there a way to Embed Word object in Visual Basic 6?I need a way to read and write to the open word file.
Question by:amiteshsinha
    1 Comment
    LVL 76

    Accepted Solution

    Several options, but start like this.
    Set a reference to the Microsoft Word Object Library. This is for the easier 'early binding' method.

    Option Explicit

    Private Sub Command1_Click()
        Dim wdApp As Word.Application
        Dim wdDoc As Word.Document
        Set wdApp = New Word.Application
        wdApp.Visible = True
        Set wdDoc = wdApp.Documents.Open("C:\MyFolder\MyDocument.Doc")
        Stop 'temp stop
    End Sub

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now