jlsmithhartfiel
Programmer
I'm trying to perform a mail merge with word and have found several examples here and on Microsoft's site. My problem is I'm getting a run-time error '48' when trying to run this basic code.
The line in red is what kicks up the error. I'm not sure what to look at. Any ideas?
I'm using VB6 sp4 and Word 2000. I've added the reference to Word 9.0 library to my project. Hope this helps,
Jessica![[ponytails2] [ponytails2] [ponytails2]](/data/assets/smilies/ponytails2.gif)
Code:
Option Explicit
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Private Sub command1_click()
Dim wrdSelection As Word.Selection
Dim wrdMailMerge As Word.MailMerge
Dim wrdMergeFields As Word.MailMergeFields
Dim StrToAdd As String
'create an instance of word and make it visible
[COLOR=#ff0000]Set wrdApp = CreateObject("Word.Application")[/color]
wrdApp.Visible = True
End Sub
The line in red is what kicks up the error. I'm not sure what to look at. Any ideas?
I'm using VB6 sp4 and Word 2000. I've added the reference to Word 9.0 library to my project. Hope this helps,
Jessica
![[ponytails2] [ponytails2] [ponytails2]](/data/assets/smilies/ponytails2.gif)