jandrade15
Registered User.
- Local time
- Today, 07:29
- Joined
- Jul 29, 2009
- Messages
- 12
Hi Everyone,
Ok, I know this seems to be an easy one but im not figuring out what im doing wrong.... I have a mail merge doc from access to word and the merge runs perfect but I want it to leave you with the mailings tab open or visible and it will not do this... below is my code
Mail merge is the only thing that it will accept as an index. I tried "mailings" but that did not work. I even have it before and after the merge just in case something was screwy but no dice. BTW i'm using ms office 2007... Thanks a bunch for any help!!
Ok, I know this seems to be an easy one but im not figuring out what im doing wrong.... I have a mail merge doc from access to word and the merge runs perfect but I want it to leave you with the mailings tab open or visible and it will not do this... below is my code
Code:
Private Sub Document_New()
Dim sPath As String
CommandBars("Mail merge").Visible = True
With ActiveDocument
sPath = .Path & "\Tracking Data v.2.accdb"
With .MailMerge
.OpenDataSource _
Name:=sPath, _
ConfirmConversions:=False, _
ReadOnly:=False, _
LinkToSource:=True, _
AddToRecentFiles:=False, _
Revert:=False, _
Format:=wdOpenFormatAuto, _
Connection:= _
"Provider=Microsoft.ACE.OLEDB.12.0; " & _
"User ID=Admin;" & _
"Password='';" & _
"Data Source=" & sPath & ";" & _
"Mode=Read;", _
SQLStatement:="SELECT * FROM `Farming_Table`", _
SQLStatement1:="", _
SubType:=wdMergeSubTypeAccess
.ViewMailMergeFieldCodes = wdToggle
End With
End With
CommandBars("mail merge").Visible = True
End Sub
Mail merge is the only thing that it will accept as an index. I tried "mailings" but that did not work. I even have it before and after the merge just in case something was screwy but no dice. BTW i'm using ms office 2007... Thanks a bunch for any help!!
