• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4183
  • Last Modified:

Automate Printing from a Bloomberg Terminal

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
greep
Asked:
greep
  • 2
  • 2
1 Solution
 
Jeffrey CoachmanMIS LiasonCommented:
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
 
greepAuthor Commented:
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
 
Jeffrey CoachmanMIS LiasonCommented:
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
 
greepAuthor Commented:
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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now