Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2005
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is what I did. I don’t know anything about V-Basic

    1. Selected Tools | Macro | Record New Macro…
    2. Record Macro dialog box, in Macro name section (entered name PLS | Selected Assign to macro icon Toolbars
    3. Customized dialog box, In commands tab, commands section, dragged icon to my toolbar (selected new button icon etc.)
    4. Selected Close
    5. Macro starts recording (cursor looks like a tape)

    I then wanted to do the followings steps for my macro:

    1. Select from Menu Bar Tools | Letters and Mailings | Mail Merge Wizard…
    2. In Select document type section, select Letters (radio button)
    3. In Step 1 of 6 section, select Next: Starting document
    4. In Select starting document section, select Use the current document (radio button)
    5. In Step 2 of 6 section, select Next: Select recipients
    6. In Select starting document section, select Select recipients section, select Use an existing list (radio button)
    7. In Step 3 of 6 section, select Next: Write your letter
    8. In Select Data Source dialog box, select Desktop, select Black Book, Excel file
    9. Select Open
    10. In Select Table dialog box, select OK (There is only one worksheet)
    11. Mail Merge Recipients dialog box opens, select clear all - Note: There is where I want my Macro to end. The rest of the steps would be done manually.

    The bottom line (I select the ion off my toolbar, nothing happens. Below is the code the computer created for me automatically. I do not know V-Basic. HELP!!

    Sub PLS()
    '
    ' PLS Macro
    ' Macro recorded 7/16/2009 by User
    '
    ActiveDocument.MailMerge.OpenDataSource Name:= _
    "C:\Documents and Settings\User\Desktop\Black Book.xls", _
    ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
    AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
    WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
    Format:=wdOpenFormatAuto, Connection:= _
    "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";Us er ID=Admin;Data Source=C:\Documents and Settings\User\Desktop\Black Book.xls;Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDBatabase Passwor" _
    , SQLStatement:="SELECT * FROM `'Black Book$'`", SQLStatement1:="", _
    SubType:=wdMergeSubTypeAccess
    End Sub

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    [quote name='TheDon' post='784931' date='16-Jul-2009 08:05']
    Code:
    Sub PLS()
    '
    ' PLS Macro
    ' Macro recorded 7/16/2009 by User
    '
    	ActiveDocument.MailMerge.OpenDataSource Name:= _
    		"C:\Documents and Settings\User\Desktop\Black Book.xls", _
    		ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
    		AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
    		WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
    		Format:=wdOpenFormatAuto, Connection:= _
    		"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=C:\Documents and Settings\User\Desktop\Black Book.xls;Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Passwor" _
    		, SQLStatement:="SELECT * FROM `'Black Book$'`", SQLStatement1:="", _
    		SubType:=wdMergeSubTypeAccess
    End Sub
    [/quote]
    It looks as though one step was recorded: OpenDataSource. If you highlight that word and press F1, you should get the help screen describing the parameters that follow. Some, such as Name, are obvious. Others perhaps are better ignored.

    I don't do merges, so I don't know what is "missing" at this point. What happens when you run the above macro?

  3. #3
    2 Star Lounger
    Join Date
    Feb 2005
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='jscher2000' post='785015' date='17-Jul-2009 05:59']It looks as though one step was recorded: OpenDataSource. If you highlight that word and press F1, you should get the help screen describing the parameters that follow. Some, such as Name, are obvious. Others perhaps are better ignored.

    I don't do merges, so I don't know what is "missing" at this point. What happens when you run the above macro?[/quote]


    Nothing. I select the icon and nothing happens!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •