Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21266

visualbasic 6.0 OLE to MS word

$
0
0
good day to everyone. i have some problems with the OLE thing. Im making now a program that can edit my word template directly. things are going so smoothly populating formfields in my word template but the thing is.. can i use OLE-Microsoft Office Document to populate one of my formfield? if so? what is the code? please help me :(
vb Code:
  1. Private Sub Command1_Click()
  2. Static wd1 As Word.Application
  3. Static wd1Doc As Word.Document
  4. Set wd1 = New Word.Application
  5. wd1.Visible = True
  6.  
  7. Set wd1Doc = wd1.Documents.Add(App.Path & "\profile.dotx")
  8.  
  9. With wd1Doc
  10.     .FormFields("w_name").Range = Text1.Text
  11.     .FormFields("w_age").Range = Text2.Text
  12.     .FormFields("w_sex").Range = Combo1.Text
  13.     .FormFields("w_exam").Range = Text3.Text
  14.     .FormFields("w_file").Range = Text4.Text
  15.     .FormFields("w_result").Range = OLE1.????????????

Viewing all articles
Browse latest Browse all 21266

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>