Chikita leaderboard

Huwebes, Nobyembre 10, 2011

How to Connect MS Word to print an output in VB 6.0

Did you ever wonder if you can connect your MS Word document to your VB 6.0 for a dynamic print output? Now you can, in this video learn how to use MS Word Forms Component Text Form and use MS Word to create custom Print Setup like Letter, Legal, A4 or any custom size and connect it to your Visual Basic programs.  Here are the codes used in this video tutorial: 

Private Sub Command1_Click()
Static wd1 As Word.Application
Static wd1Doc As Word.Document
Set wd1 = New Word.Application
wd1.Visible = True

Set wd1Doc = wd1.Documents.Add(App.Path & "\profile.dot")

With wd1Doc
  .FormFields("W_name").Range = Text1.Text
 .FormFields("W_address").Range = Text2.Text
    .FormFields("W_occupation").Range = Text3.Text
End With
Set wd1 = Nothing
Set wd1Doc = Nothing

End Sub

Share and Enjoy!



12 komento:

  1. WALA BANG IN CHRONOLOGICAL ORDER ANG VIDEOS AND TUTORIAL? MAY

    TumugonBurahin
  2. UNG video kasi nauna activity 7 then 5 then di ko na mahanap ung ibang activity. san pedde makita to?
    may online tutorial ba kayo? paid free?

    TumugonBurahin
  3. Sir panu po maprint yung laman ng imagebox sa msword as an output? Tnx po

    TumugonBurahin
  4. repected sir,
    this program is not working(How to Connect MS Word to print an output in VB 6.0) please give me the suggession. i need very useful this program. what is your using microsoft word version, vb version and imports classes. please give me the suggession as soon as possible.

    TumugonBurahin
  5. repected sir,
    this program is not working(How to Connect MS Word to print an output in VB 6.0) please give me the suggession. i need very useful this program. what is your using microsoft word version, vb version and imports classes. please give me the suggession as soon as possible.

    TumugonBurahin
  6. pano po mag display sa data report ng for example more than two selected item mula sa listview... thank you po

    TumugonBurahin
  7. What's the difference between documents. Open and document. Add
    I'm new to vb6 so asking this question.
    Thanks in advance...

    TumugonBurahin
  8. Hi

    Can any one please clear my doubt.

    Before word.documents.open in vb.
    The word file already opened from the shared folder.
    Now if I run the code then I am getting an error "This action cannot be completed because the other program is busy. Choose "switch to" to activate the busy program and correct the problem." This message is in a pop up message....

    TumugonBurahin