RSFactoryTalk View SE VBA to screen print & save as PDF

mgallgood

Member
Join Date
Dec 2016
Location
Tennessee
Posts
19
I'm looking for details on some VBA functionality in FTViewSE. I've been asked to look into programmaticly performing a Print Screen then saving the clipboard content to a file. Preferably a PDF file, but at this point I just need help getting the info out of the clipboard. I can find examples using VBA in Excel but these all use built in Excel image type constants like xlPiture or xlBitmap. Since this is not running in Excel, but in FTV, I'm thinking those won't work, but I could be wrong.

The general question, is there a FTViewSE VBA Programmer's Guide (manual) on the web somewhere that it can be downloaded? Having access to documentation on the FTView object model would be helpful in this and other tasks.

More specifically, can anyone provide some specifics on how to accomplish this task?

Thanks,
Mike
 
have you tried using a pdf printer like bullzip as the default print and just print the screen to it. Object browser iv Ftview VBA window show you all available objects and properties
 
you could call a external program which make the printscreen and saves it to a file. CmdCaptureWin.exe is one of theese.

For example:
Dim sTimestamp As String
sTimestamp = Format(Now(), "yyyymmddhhnnss")
Call Shell("C:\CmdCaptureWin.exe /f Screenshot_" & sTimestamp & ".png /d C:\Screenshots\")
 
A follow up.
I have the code working to perform the PrtScrn and then write the clipboard contents to a jpeg file (using the Shell command to launch MS Paint).

At this point I still need to figure out how to send the jpeg to a PDF Printer or otherwise generate the PDF file. Since VBA does not have a Printer object I'm wondering if this is possible.

To narrow the focus a bit, here are two questions:
1) Since I have MSPaint open and have the TaskID (returned from the Shell command), is there a way to utilize this to have Paint print the doc to a PDF file?

2) With a jpeg file now existing, is there a way to simply send it to the PDF Printer directly?

Thanks.
 
I got it to work by issuing a "Ctrl-P" and then an "Alt-P" key sequences while Paint was still open. This solution is a little hokey but it works. Prior to this I'm setting the file name for the PDF printer to use (in the registry) so it knows how to name it and where to put it. There are a few delays that will need to be adjusted between the various key sequences used. I'm guessing those will be dependent upon the loading of the machine, but as long as they are long enough to allow the various dialogs to present then I think it will work.

Thanks.
 
I got it to work by issuing a "Ctrl-P" and then an "Alt-P" key sequences while Paint was still open. This solution is a little hokey but it works. Prior to this I'm setting the file name for the PDF printer to use (in the registry) so it knows how to name it and where to put it. There are a few delays that will need to be adjusted between the various key sequences used. I'm guessing those will be dependent upon the loading of the machine, but as long as they are long enough to allow the various dialogs to present then I think it will work.

Thanks.

you could do it, but its way to error-prone. What if someone presses a key oder mouse button during that process. Sure it wont work.
Just use a pdf printer which u can control from command promt, for example PDFCreator. Take a screenshot with a command, save the .jpg or .png and send it to the pdf printer.
 
you could do it, but its way to error-prone. What if someone presses a key oder mouse button during that process. Sure it wont work.
Just use a pdf printer which u can control from command promt, for example PDFCreator. Take a screenshot with a command, save the .jpg or .png and send it to the pdf printer.

I'm sure it won't, but this was an afterthought on the project and I was only asked to step in and look at this without spending a lot of time. They already had some of this code in place on another FVTiewSE system so I hijacked that and modified it just a bit so it isn't like they don't already have that issue elsewhere, and are OK with it. Plus this functionality is simply to generate a PDF of a screen cap of the View screen. It is not a critical function. Additionally it only takes a couple of seconds to run and then Paint is terminated so even if they deliberately start punching keys and cause the PDF to not print then it isn't the end of the world.
 

Similar Topics

Hi, does anyone have any experience setting up Alarm & Events historian in RS Factory Talk SE running on a PC in Local Stand-alone. I need to log...
Replies
8
Views
7,969
Hey everyone and anyone that can lend a helping hand. I have a project that I am being asked to add some animations of Solidworks or "3D" models...
Replies
7
Views
111
Hi All, we've recently upgraded from FTView SE v10 to v12. Since the upgrade we've been having a problem where the HMI is slow to update tags in...
Replies
0
Views
38
I can't seem to get the Panel View Plus 7 standard edition to downgrade to V_11, when I check the AB downloads and compatibility websites for this...
Replies
1
Views
95
Good morning, I have a question, I would like to know if I can send an Excel file to an email from my panel view and see how it is possible to...
Replies
1
Views
118
Back
Top Bottom