Dear Jim & GWBaldwin,
Just a correction: Corey perhaps is the name of the macro's author. Mine is Amit. Hopefully we can get this macro to work.
Here are the instructions on the companion disk for Sidekick 2.0 Following that is the installation instruction from within Word and the error message received. Also find the detailed screen while debugging in Visual basic. Hopefully, some light can be shed on why the macro does not work.
README FILE FOR MICROSOFT WORD 6.0 MACRO
SIDEKICK MAIL MERGE
This SKWW60.WRI file tells you how to do two things:
1. Install the macro
2. Use the macro
1. INSTALLING THE MACRO
------------------------------------------
For the macro to function correctly, you need to place certain files into specific directories on your hard disk.
1. Copy the files SKDLGDLL.DLL and EXPORT.DLL from the temporary directory into your C:\WINDOWS directory.
2. Copy the file SKWW60.DOT into the TEMPLATE subdirectory of the directory you installed Word into (by default, C:\WORD6).
Launch Word. Open the file SKWW60.DOT and follow the instructions onscreen. The instructions walk you through the installation program, which enters the Sidekick macro into your Normal template. This makes the Sidekick macro accessible to you no matter what file you have open in Word.
If you want to assign the macro to a toolbar button, follow these steps.
1. Close SKWW60.DOT if you haven't already.
2. Create a new file.
3. Choose Tools|Customize. The Customize dialog box appears.
4. Select Macros from the Categories list. The Sidekick macro appears in the Macros list.
5. Select Sidekick from the Macros list, and drag it to the toolbar. A button appears where you drop the macro, and the Custom Button dialog box appears.
6. Select an appropriate graphic for the button and chose Assign. Close the Customize dialog box.
2. USING THE MACRO
--------------------------------
The Sidekick Mail Merge macro allows you to import a Sidekick cardfile into Microsoft Word 6.0 for use in a mail merge. To run the macro, click the toolbar button you assigned to it using the above steps. If you have not assigned a button to it, choose Tools|Macro. The Macro dialog box appears. Select Sidekick from the list of available macros, and click Run.
You will be prompted to choose a Sidekick cardfile. After you choose one, the macro will automatically create a text-only version of the cardfile (with a .TXT extension) and import using the Word Mail Merge feature. After a moment, a new document will appear with the usual Word Mail Merge toolbar. Create your mail merge template in this new document. Refer to your Word manuals for further instructions on creating a mail merge.
NOTE: If you like, you can delete the .TXT versions of the cardfiles.
INSTRUCTIONS IN WORD:
To install the Sidekick Mail Merge macro, follow these steps.
1. Display the Starbar toolbar.
2. Choose View|Toolbars.
3. Check the Starbar box.
4. Click OK.
5. Click the button on the Starbar toolbar.
The macro is now installed! Close SKWW60.DOT
My comments:
On running the macro, I get the following error in Microsoft Visual basic:
Run time error "48"
File not found Skdlgdll.dll
When I run debug, I get the following:
(The cursor highlights the line "CHOOSE_RESULT = OpenDlg(hwnd, szfn$, szfilter$, szExt$, szTitle$, nHelpID)
If CHOOSE_RESULT <> 1 Then Continue = 0)
Dim szfn$
Dim szfilter$
Dim szExt$
Dim szTitle$
Dim nHelpID
Dim CHOOSE_RESULT
Rem \\\\\\\\\\\\\\\\\\\ CHOOSING CARDFILE
hwnd = 0
szfn$ = ""
szfilter$ = "Sidekick Cardfile (*.SDB)|*.sdb||"
szExt$ = "sdb"
szTitle$ = "Choose Sidekick Cardfile"
nHelpID = 0
CHOOSE_RESULT = OpenDlg(hwnd, szfn$, szfilter$, szExt$, szTitle$, nHelpID)
If CHOOSE_RESULT <> 1 Then Continue = 0
SourceName$ = szfn$
End Sub
Private Sub ConvertCardfile()
Dim lpSrcName$
Dim lpExt$
Dim lpTarName$
Dim EXPORT_RESULT
Dim NameLength
Dim NameNoExt$
Rem \\\\\\\\\\\\\\\\\\\ CONVERTING CARDFILE
lpSrcName$ = SourceName$
lpExt$ = "TXT"
lpTarName$ = ""
EXPORT_RESULT = SKW_ExportCardfile(lpSrcName$, lpTarName$, lpExt$)
If EXPORT_RESULT = -1 Then WordBasic.MsgBox "Out of memory. Shut down some programs and try again."
If EXPORT_RESULT = -2 Then WordBasic.MsgBox "The selected cardfile is in use. Close it and try again. Or, change the access rights to the file and try again."
If EXPORT_RESULT = -3 Then WordBasic.MsgBox "Word could not create a converted version of the cardfile. Remove any previously converted versions and try again."
If EXPORT_RESULT = -4 Then WordBasic.MsgBox "The selected file is not a Sidekick 2.0 for Windows cardfile."
If EXPORT_RESULT = -5 Then WordBasic.MsgBox "The selected file is not a Sidekick 2.0 for Windows cardfile."
If EXPORT_RESULT <> 1 Then Continue = 0
If EXPORT_RESULT = 1 Then
NameLength = Len(SourceName$)
NameLength = NameLength - 3
NameNoExt$ = WordBasic.[Left$](SourceName$, NameLength)
TargetName$ = NameNoExt$ + "TXT"
End If
End Sub
Private Sub OpenDB()
WordBasic.FileNew Template:="Normal", NewTemplate:=0
WordBasic.MailMergeMainDocumentType 0
WordBasic.MailMergeOpenDataSource Name:=TargetName$, ConfirmConversions:=0, ReadOnly:=0, LinkToSource:=1, AddToMru:=0, PasswordDoc:="", PasswordDot:="", Revert:=0, WritePasswordDoc:="", WritePasswordDot:="", Connection:="", SQLStatement:="", SQLStatement1:=""
WordBasic.MailMergeEditMainDocument
End Sub