Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Thread Tools Display Modes
Old 08-01-2009, 09:20 PM
jandrade15 jandrade15 is offline VBA Code for making "mailings" tab active Windows Vista VBA Code for making "mailings" tab active Office 2007
VBA Code for making "mailings" tab active
Join Date: Aug 2009
Posts: 1
jandrade15 is on a distinguished road
Unhappy VBA Code for making "mailings" tab active

Hi Everyone,

I have a word doc that has the following code:
Private Sub Document_New()
    CommandBars("Mail merge").Visible = True

    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:="", _
            .ViewMailMergeFieldCodes = wdToggle
        End With
    End With
End Sub
this was for a 2003 doc and now I cant get the "mailings" tab to be pop up after the code is done? It opens up with the home tab and I want the mailings tab seems that the commandbars code is incorrect since it doesn't reference the tab fields? Does anyone know how to make this happen? Thanks a million for any help!! This has been quite frustrating!
Reply With Quote

Thread Tools
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wierd symbols inplace of "space", "indentation" etc aka.bhagvanji Word 5 02-16-2012 11:50 AM
create a hotkey for "add sender to blocked senders list" mytoyo Outlook 0 03-29-2009 09:39 AM
VBA Code for making "mailings" tab active MYOB and "Item.Send error" Outlook message peter_lambros Outlook 1 12-06-2008 08:24 AM
"IF" "THEN" statements in Macros mfgeng_iss Misc 0 10-04-2007 07:31 AM
"open" or "open using" option not availa ccd Outlook 0 09-22-2006 01:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:18 PM.

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