Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 10-30-2014, 04:27 AM
QCHA QCHA is offline csv issue Windows 7 32bit csv issue Office 2010 32bit
Novice
csv issue
 
Join Date: Oct 2014
Posts: 5
QCHA is on a distinguished road
Default

Yes, we copied the code and changed the drives, attached this in case we have done something wrong (more than likely):

Private Sub Document_New()
' Demo code for a vba-driven mailmerge.
Dim wdApp As New Word.Application
Dim wdDoc As Word.Document
wdApp.DisplayAlerts = wdAlertsNone
Dim StrSrc As String, StrDoc As String
StrDoc = "J:\QLLetters\ASBL001.doc"
StrSrc = "H:\QL\ASBL001.csv"
Set wdDoc = wdApp.Documents.Open(StrDoc)
With wdDoc
With .MailMerge
.MainDocumentType = wdFormLetters
.OpenDataSource _
Name:=StrSrc, ReadOnly:=True, AddToRecentFiles:=False, LinkToSource:=False, _
Connection:="", SQLStatement:="", SQLStatement1:="", SubType:=wdMergeSubTypeOther
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=False
.MainDocumentType = wdNotAMergeDocument
End With
.Close False
End With
wdApp.DisplayAlerts = wdAlertsAll
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
csv issue Footer Issue WorldBuilder Word 6 04-04-2014 03:18 PM
have no title for my issue krayot Excel 4 01-06-2014 05:56 AM
Email Set Up Issue MothAudio Outlook 0 04-01-2012 07:40 AM
New Issue jantoine Outlook 1 09-28-2010 06:08 PM
Possible Security Issue? GarP Excel 0 04-08-2010 07:47 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft