Solved

Automate Printing from a Bloomberg Terminal

Posted on 2008-10-31
4
3,629 Views
Last Modified: 2013-11-27
Hi,
on our Bloomberg terminal, we have a 'Customized Button' called AUTO PRINT.
I'm not sure if this is a standard Bloomberg feature, or something someone here defined in the past.

We press ALT+B to get to BLoomberg Customized Buttons, then edit the Bloomberg Keys section  to set the print instructions which are multiples lines like this:

TICKER_AND_EXCH_CODE<EQUITY><GO> DVD <GO><TABR><TABR><TABR><TABR>N<GO> D <GO><PRINT> 1 <GO><PRINT>
the only variable being the TICKER_AND_EXCH_CODE

The user then closes the Customized Buttons windows and clicks the AUTO button on the toolbar to run the print job.

I am trying to automate this process from VB

I've had some limited sucess controlling the Bloomberg windows with AppActivate and SendKeys.
But I need help  

Sending ALT+B to access the Customised Buttons windows
I've used SendKeys "%B"  but with no effect.
SendKeys "B" types the letter into the screen, but the % Alt prefix does not appear to do anything

Even if I could access the customised button settings, with SendKeys, there does not seem to be anyway of remotely 'Clicking' a Bloomberg Toolbar object - no keyboard short cut

Is there another method of automating prints from Bloomberg screen that I could use?
Any help will be grateful appreciated
Thanks
0
Comment
Question by:greep
  • 2
  • 2
4 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22860688
greep,

This may not work at all unless the "Auto" button in Bloomberg has a Hotkey assigend to it.

Is the Bloomberg program Dos based, Windows based, or something else entirely (Terminal Server, Citrix, ...ect)

Since you did not post the code you are using, we are forced to guess..

Your code must:
-Set focus to the bloomberg "Program"
-Wait for the processor (DoEvents)
-Sendkeys Alt-b , but add in the Wait=True argument

Something like this:
    'Your code to activate the Bloomberg Application
    DoEvents
    SendKeys "%B",True
    'You other sendkeys code here
    '...ect

Of course this is air code, but to be sure, you should try adding the Doevents command and the Wait argument of the SendKeys command.

JeffCoachman
   
0
 

Author Comment

by:greep
ID: 22874748
Thanks for replying
As far as I can see there is no keyboard shortcut to the Toolbar buttons, so that route is out.
So instead I've tried tried sending keys directly to the Bloomberg command line.
In the example code below everything seems to work  - except the printing

SendKeys "{PRTSC}", True  - does nothing

Is there another way of getting Bloomberg to Print?

I'm running a Bloomberg Terminal on Windows XP, but I think the terminal program may be DOS based, it's certainl not a standard windows programme
Do Until rs.EOF
	AppActivate "1-BLOOMBERG", True
	Sleep 1000
	SendKeys "ID " & rs!Sedol & "~", True
	Sleep 1000
	DoEvents
	SendKeys "DVD~", True
	Sleep 1000
	DoEvents
	SendKeys "{TAB 4}N~", True
	Sleep 100
	DoEvents
	SendKeys "D~", True
	Sleep 1000
	DoEvents
	SendKeys "{PRTSC}", True
	DoEvents
	SendKeys "1~", True
	Sleep 1000
	DoEvents
	SendKeys "{PRTSC}", True
	Sleep 1000
	DoEvents	
	rs.MoveNext
Loop

Open in new window

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22882562
greep,

  "SendKeys "{PRTSC}", True  - does nothing"
It does to something, ...it copies the screen to the windows clipboard.
It does not "Print" directly to the printer

In the "Old Days" the Print Screen key actually sent the screen info directly to the printer.
But that is when most all programs were DOS based.

With the advent of WYSIWYG (What you See Is What You Get), the printscreen key takes a snapshot of the current screen and copies it to the Windows clipboard.
From there you have to pates it into a graphics program in order to "Print" it.

If I were you I would contact Bloomberg directly. Many of these products have an interface that Access VBA can interact with.

Sendkeys is one of the most unreliable and dangerous commands in VBA.
And should only be used for *Simple* tacks, if there is no other way.

JeffCoachman
0
 

Accepted Solution

by:
greep earned 0 total points
ID: 22884418
Thanks for replying
Yes I know that PRTSC copies the screen to the clipboard, but in Bloomberg it is also the quivalent of the <PRINT> command
As it happens I seem to have found a soultion
I've copied the VBSendKey method found here
http://www.wilmott.com/messageview.cfm?catid=10&threadid=35254
sending VK_SNAPSHOT  into the Bloomberg terminal does make it print
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question