You don't need the brackets if: 1. you do not have spaces in your table/field names, and 2. you do not use reserved words for your names.
So, your SQL may simply look like:
SELECT EmployeeID, LastName, FirstName
FROM Employees ORDER BY LastName, FirstName;
Depending on where you live, it may be beneficial to you to take your computer to a place where somebody have some experience in recovering files. They should have software to do it. And it may be a lot faster, cheaper, and more reliable than doing it yourself.
And I would not focus on ‘Recycle...
By 'to go' - do you mean 'connect to B and get (Select) some records from some tables in B'?
Or 'run some code in B'? Or 'transfer records between A and B'? Or... what do you want to do?
Based on this place: How do I change default printers in VBA, you can change default printer, print, and change it back to whatever printer was there to start with:
Sub label_query_to_print(data_query_to_print, excelPath, printer_id_value, ip_address_value)
Dim prt As Printer
Debug.Print...
With your:
With ActiveDocument.MailMerge
.Destination = wdSendToPrinter
Other options for Destination are:
Name
Value
Description
wdSendToEmail
2
Send results to email recipient.
wdSendToFax
3
Send results to fax recipient.
wdSendToNewDocument
0
Send results to a new Word...
Do you mean something like this:
Sub RunBothMacros()
Call label_query_to_print(pass your attr here)
Call PrintToPrinterByIP
End Sub
or, do you want to use anything that label_query_to_print sets/gets to pass to your PrintToPrinterByIP ?
strongm, I will give it a shot and report back
As a side note, I've just got the message that my original code started working all of the sudden. Everybody is surprised (me included) and they (users) give me a credit for fixing it (I will take it :) Who knows what had happened? Gremlins?
Edit -...
Nice progress, thank you combo
Your suggestion works - I had to replace some constants since I use Late Binding (wdReplaceAll = 2, wdFindContinue = 1) and I need to eliminate some extra code
Option Explicit
Sub outlookmail()
'Use the code from...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.