Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Way to Embed Microsoft Word in Visual Basic 6

Posted on 2006-05-16
4
Medium Priority
?
307 Views
Last Modified: 2013-11-25
Hi,
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.
Thanks
0
Comment
Question by:amiteshsinha
1 Comment
 
LVL 77

Accepted Solution

by:
GrahamSkan earned 1000 total points
ID: 16692362
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
    wdDoc.Close
    wdApp.Quit
End Sub
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

578 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