• We just launched and are currently in beta. Join us as we build and grow the community.

Convert from VB6.0 to Word

CatFingersC

High-Ticket Closer
C Rep
0
0
0
Rep
0
C Vouches
0
0
0
Vouches
0
Posts
138
Likes
83
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
In this tutorial, we will create a program that can convert the inputted textbox in vb6.0 into a Word Document.

Now, let's start this tutorial!

1. Let's start this tutorial by following the following steps in Microsoft Visual Basic 6.0: Open Microsoft Visual Basic 6.0, click Choose Standard EXE, and click Open.

2. Next, add only one Button named Command1 and labeled it as "Convert to Word". Add also TextBox named Text1 for our input and displayed it in Microsoft Word. You must design your interface like this:

worddesign.png


3. Now put this code for your code module. This code is for Command1_Click:
  1. Private

    Sub

    Command1_Click()
  2. Dim

    WordSC As

    Object
  3. Set

    WordSC = CreateObject

    ("Word.Basic"

    )
  4. WordSC.appMaximize
  5. WordSC.FileNewDefault
  6. WordSC.Insert Text1.Text
  7. WordSC.StartOfDocument
  8. Text1.Text = WordSC.Selection

  9. End

    Sub

Explanation:

We have initialized first variable WordSC as an Object then later on we set this variable to create an object as a Word Document.. Word.Basic is the name of the application that we have to call and display after clicking the button. appMaximize property will first set your Word Document as maximizing it. FileNewDefault is for creating a new Word Document. Insert Text1.Text will insert the content of the inputted text in the Textbox. StartOfDocument will start opening the Word Document. And this Selection property of the Word Document selects the text of our textbox to be displayed on it.

Output:

wordoutput1.png

wordoutput2.png


Download the source code below and try it! :)

For more inquiries just contact my number or e-mail below.

Best Regards,

Engr. Lyndon R. Bermoy
IT Instructor/System Developer/Android Developer
Mobile: 09488225971
Telephone: 826-9296
E-mail:[email protected]

Follow and add me in my Facebook Account: https://www.facebook.com/donzzsky

Visit and like my page on Facebook at: https://www.facebook.com/BermzISware


Download
You must upgrade your account or reply in the thread to view hidden text.
 

452,292

323,341

323,350

Top