S
smh_5
Can someone please point me in the right direction. I am trying to execute a
mailmerge from a vbscript. I need to be able to merge just the record
meeting the criteria (ie. Receipt = 2222). Below is the code I'm trying to
use but I keep getting data not found. Any help would be appreciated even if
I'm doing it all wrong.
Dim doc
Dim wrdApp
set wrdApp = CreateObject("Word.Application")
set doc = CreateObject("Word.Document")
Set doc = GetObject("H:\New samples\merge2.dot")
With doc.MailMerge
.EditDataSource
If .DataSource.FindRecord(FindText=2222, _
Field="Receipt") = True Then
MsgBox "Data was found"
else
MsgBox "Data was not Found"
End If
End With
wrdApp.Visible = True
Thank you
mailmerge from a vbscript. I need to be able to merge just the record
meeting the criteria (ie. Receipt = 2222). Below is the code I'm trying to
use but I keep getting data not found. Any help would be appreciated even if
I'm doing it all wrong.
Dim doc
Dim wrdApp
set wrdApp = CreateObject("Word.Application")
set doc = CreateObject("Word.Document")
Set doc = GetObject("H:\New samples\merge2.dot")
With doc.MailMerge
.EditDataSource
If .DataSource.FindRecord(FindText=2222, _
Field="Receipt") = True Then
MsgBox "Data was found"
else
MsgBox "Data was not Found"
End If
End With
wrdApp.Visible = True
Thank you