Solved

Automate Printing from a Bloomberg Terminal

Posted on 2008-10-31
4
3,749 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

738 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