Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Search Application Name in CreateObject MS ACCESS 1

Status
Not open for further replies.

replyrpatil

Programmer
Apr 28, 2007
24
US
Dose any one know how to search application name or how to add other application to CreateObject . For example the code below will open WORD and prints word document “Wordtest” from MS access , I need to do similar thing BUT for a different application ( Instead of Word I want to Open EasyLabel). I know WORD, EXCEL ,POWER POINT etc are COM application supported my MS Access.

Is there a way to add a different application to this list


Function PrintDoc()
Dim WordObj As Object
Set WordObj = CreateObject("Word.Application")
WordObj.Documents.Open "C:\Wordtest.doc"
WordObj.PrintOut Background:=False
WordObj.Quit
Set WordObj = Nothing
End Function

So I wrote this

Function Elabel()
Dim EasyLb As Object
Set EasyLb = CreateObject("EasyLabel.Application")
EasyLb.Documents.Open "C:\test.fmt"
EasyLb.PrintOut Background:=False
EasyLb.Quit
Set EasyLb = Nothing
End Function

This gives me error that ActiveX cannot create object

How do I search application names that are supported by ActiveX or how can we add other application to createobject ( why did the programmer put WORD.Application where did he come to know this .


My main aim it to print a Barcode template in EasyLabel from MS Access

The following code opens the template in easylabel but I want to print not open

'FmtPath = "C:\Program Files\Tharo\EASYLABEL Platinum\easy.exe C:\test.fmt"
'RetVal = Shell(FmtPath, vbMaximizedFocus)


CAN ANY ONE SUGGEST ME SOME SOLUTION

Thanks





 
The program has to support OLE Automation (not sure if that's the current term for it any more). Many Microsoft programs support it, but it's much less common for other programs.

The best place to ask is whoever makes EasyLabel. If they've gone through the trouble of supporting automation, they will likely be advertising that feature.

Otherwise, you will have to use whatever command line arguments or API's (if any) that the program supports. It may simply not provide any automated way of doing what you want. The only other solution might then be to use SendKeys to press buttons, open menues, etc. (a fragile solution at best).

 
Joe,

How to SendKeys to press buttons

What I need to to do is Press "Control
+ P" button on keyboard to initiate Print.


Is there a way we can press "Ctl +P" by program
 
I got it

SendKeys "^{p}", True


Thanks once again Joe for your suggestion


Thanks
Rahul
 
If you need the single ("EasyLabel") thing then STOP. If you would just as soon or refer, you can easily print bar codse labels directly from Ms. Access. Do s search / addvanced search on "BARCODE" here (in Tek-Tips). There are a few threads which lead to (VBA) code to print bar codes. You can also buy a "font" disc which can be used to print them. Personally, I would prefer either of these soloutions to invoking a seperate app just to print bar codes.



MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top