What are my options to print an email to TIFF from Outlook via an addin? - pdf

We have a process at our company that processes TIFF images. I have a project where I want to be able to capture emails that people have received and let them pass it on to our imaging process. Right now forwarding an email isn't really an option but our initial thought was that we could create an Outlook addin that would create and send an image of the email to our internal webservice and it would just work.
I'm developing on Windows 7 with VS2010 and Outlook 2007.
I have the basic addin framework setup - that seems to work OK. The addin is there, popping a regular Windows form where I can do my stuff. But now I'm running into problems. First I was going leverage the built-in Microsoft Office Document Image Writer which can write to TIFFs. However, this doesn't appear to be installed as part of Office 2007 on Windows 7. Then I found some references that it didn't work on Win7 64bit in the first place, and that Microsoft was phasing it out in favor of their XPS printer anyway.
Then I moved on to thinking I could maybe use PDFCreator. This sort of works, except it looks like I have to actually have PDFCreator installed on the client machine, too. I was really hoping I could just bundle the dll and PDFCreator could natively "print", but it seems rely on you setting the active printer to "PDFCreator" and still printing to that. I was already maybe going to run into problems pushing a custom addin out to users in the first place; I don't know if I could get a new printer rolled out as a requirement, too.
On top of that, you apparently can't set the active/default printer in Outlook once it's running. So my plan to run the addin, change the default printer to PDFCreator, print it, then change it back isn't going to work after all anyway.
We really wanted to be able to capture emails as if the user had printed them out and scanned them, which is what they have to do now. I would really not like to rely on copying/pasting into another application if I can help with it.
Sooooooo, what other options might I have? Is there any close to native functionality in Windows or Office that would let me print to something and eventually get a TIFF? Does it look like I'm going to have to try and string together a bunch of 3rd party tools or something? It looks like the only way to "print" an email is to do the MailItem.PrintOut() command, which is just going to go to whatever the current default printer is. Are there any other TIFF-printing things available that wouldn't involve installing a new virtual printer on the end user's machine? Any other ideas? Thanks for any help!

Although you ruled it out at the start of the question...
Assuming you need those tiffs at a central location and not at the employee desktop.... I'd still advise you to have your addin forward the respective mail to a central location (as an attachment to a automated mail, or perhaps just write it to a queue folder on some network location), then have a central process pick it up and print it out to tiff files.
Unless you have exact control over the client machines at your company (which from the sound of it, you don't), you really want to move some fickle as 'switching printers in Outlook' away from the clients.
That doesn't mean this approach doesn't require hacks as well, because that central process will be running outlook to do the work.
I assume it is important that your tiffs look like they were actually printed from Outlook, if not please add that as extra information to your question, as it opens new routes. Like capturing the email-screen rendering and putting that inside a tiff file, which can all be done on any desktop machine.

Related

How to show custom update/modifications text when I publish my outlook-addin. VB.NET

Recently I have created an Addin for my outlook 2013 in VB.net. I usually do a lot of modifications on this application especially in the beginning. These modification automatically download when a user starts its outlook as soon I publish the project.
The question I have, and which I cant seem to figure out how to do it is:
Is it possible to show the user some kind of custom made UPDATE pop-up text when outlook automatically updates the addin?
So a user starts its outlook, then the outlook usually executes the updates pretty fast and then I want them to show some kind of message which contains the updates being done.
I have no clue if this is possible though and I cant seem to find an option for it in the publish tab of visual studio. Can this be done with code, and if so, how?
ClickOnce doesn't provide anything for that. See Deploying an Office Solution by Using ClickOnce for more information.
In the new version of the software which you are going to publish you may add a message box. It can be shown for the first run only. For example, add a windows registry key which indicates that the add-in (new version) is run for the first time. Reading the value at runtime will help you to decide whether such message box is required or not.

Managing Adobe PDF printer- How to force off the option to rely on system fonts

I am running a Citrix-driven environment, and I have a vital piece of software that creates a PDF repository of all reports as they run. The problem I have is that the users' printers must populate into the environment (Not just the default printers- ALL of them), and a number of the computers have Acrobat 9 or X on them. The software that creates the reports REQUIRES that the Rely On System Fonts is turned off, but some users have it turned on when it comes to the PDF printer on their computers. Sometimes, when user x goes to create a report, it will grab the printer from user y's session that may not have the option properly unset- Then user x's irreplaceable report is lost. The application is a Dexterity application, and I don't have access to the source. Is there a way, in Citrix or in AD, to script this one option to be unset properly? Any idea if there is a registry key or some kind of hook I can activate with a powershell script to fix this headache? I appreciate any help.
I have been researching for weeks to figure this out for myself, and I was looking for one more answer and found your question. To fix your problem I was able to find that the registry key found here:
[HKEY_CURRENT_USER\Printers\DevModePerUser]
Contains all of the current printer properties. If you export it, you can run a script to add the reg key during login. Just make sure that you restart the spooler after words, just to make sure that the changes apply. Also the settings will only apply to the printer with the same name, so you have to have a different reg key for each different printer name, if you have several. I just esported the key after I had changed the printer settings to how I liked them, and then edit the .reg file to remove any data about other installed printers to make sure that the .reg file wouldn't affect any other printers.
Apparently, this problem is a common problem. Microsoft has acknowledged that the PDF creation issue I am trying to avoid is an issue in GP, starting in (Think it was version) 7. The Microsoft-recommended workaround is to open the PDF Printer properties and uncheck the Use System Fonts box. Adobe does not support this configuration, so they will not provide a clear way to implement it at a network level with clients in many locations and 4 different major versions of Acrobat. The closest I came was a post that identified an incredibly long string I have to hexedit that seems to change in specific minor versions of Acrobat. Way to go M$ and Adobe. So, in other words, no support on major product lines from two major companies. I have nowhere else to go at this point. If anyone else has a solution to this problem, I'd love to hear it. Thanks!

VbaProject.OTM deployment

I came by this page and was thinking about the best method to distribute my VbaProject.OTM file (located into %appdata%\Microsoft\Outlook\) to a bunch of ~30 users at my office. Is it better to simply copy/paste the OTM file onto the network and then copy/paste it back to all users' computers (manually or with a .bat) OR would it be better to use the method described in the link above to generate a OPS file and import it back with Proflwiz.exe? What's the difference?
We are all on Microsoft Office Outlook 2003 actually, we might upgrade to 2007 one day but still years from now.
Finally came up with some elements to deploy a Outlook VBA Project. There are a lot of ways to do this, but the easiest way to do so without installing anything and keeping the same methodology would be to run a OTM file directly from a server. I found out that the process outlook.exe has a parameter altvba that allows to specify another path to run the OTM file from. Here is en example:
outlook.exe /altvba "\\myServer\myFolder\myFile.otm"
This allows me to update only one file to get all computers updated. Obviously, if the file is big and the server's ping is on the high side, it may delay the launch of Outlook. The other problem with this method is that everybody will have to shut down Office if you want to update the OTM file on the server (and if you do work in an office where everyone uses Outlook, you do know that it is impossible to get everyone to shut it down at the same time, except if you code a macro to do so eventually). To prevent both those problems, I could setup a batch file to copy the server OTM file clientside everytime there is a new version (just have to check the NTFS last-modify attribute). This way, Outlook will boot with a local file, the batch file take 2-3 seconds to copy the file if needed (or will launch Outlook instantaneously) and there will be no problem updating the OTM file on the server. Users will have to start Outlook with the batch file (or with the slightly different outlook.exe path with the altvba parameter, so either way they need a different shortcut/file to start off the first time). One other advantage of the altvba is that it's still easy for the user to run Outlook without it (to see if the VBA is problematic or not in case Outlook is sluggish) and the file will remain unchanged after a Outlook reinitialization.
Others solutions include a COM complement that can be developed in a lot on languages including VB6 (no conversion needed from VBA). There is also a bunch of tools included into Microsoft Office XP Developer that could help getting the job done (not free however, especially if you need the most up-to-date version).

Creating PDF file in PowerBuilder

I am new to PowerBuilder. I got an assignment to create a PDF file using PowerBuilder. How can I do that?
Our organization used to use Ghostscript, but has instead moved to Amyuni.
as suggested by Alberto Megia, download PDF creator, but dont use SAVE AS.
After you install pdf creator it will install a printer, use that printer to save the
datawindow with the print function.
after call print function, you will see a "Save as" dialog.
If you use "saveas" function, the pdf will not have the format that the datawindow shows.
What version of PowerBuilder are you using? The most recent versions have PDF capability built in (using Ghostscript).
Install Ghostscript.
Get PDFCreator for free there and install it.
Then you can save as PDF any datawindow or datastore with the statement:
dw_1.saveAs(path_where_to_save_with_name_of_file.pdf, PDF!, true)
Third parameter is for override if the file exists with that name. I hope it works for you.
Regards,
Alberto
We just use Ghostscript. I wrote Ghostscript setup instructions earlier. We also print Word documents we've filled in to PDF from our app by printing them to 'Sybase DataWindow PS' printer then running Ghostscript to make the PDF.
Good Question - There really isn't an easy way other than finding a third party tool. I've tried the prior method mentioned and it does work but not without headaches and you are left with deployment headaches, deploying ghost script and having to make sure Post Script drivers are on the client.
I ended up trying many PDF converters, both free and paid, the one that worked most seamlessly was one that installed as a "printer" such as if you have Adobe installed on the PC, but you need to dynamically verify existence of the printer via RegistryGet and if it doesn't exist ask user to install or install it dynamically via code, and registry entries (not fun).
After several headaches mostly related to deployment issues I ended up going with a server solution, but it requires having a server that you can have a process (distiller) running that grabs post script files and distills them to PDF. I used a response window with progress bar, the PB app printed post script file to server location upon which the distiller grabs and converts. My PB app polls the server until it finds the PDF, or the user cancels whichever comes first. With a good distiller the process is fast (< 5 seconds) which was acceptable to our users.
Upon existence of the PDF, we'd attach it to an email and send via Oracle (mapi). This solution limits the requirements on client to post script driver which in most corporate environments is there, but you need to check it via Registry. Maybe there is a better solution out there since I did this last, around 2008.
fyi- I usually don't make vendor recommendations but will in this case because there was one that stood out in ease of use and quality, it was called PDFCreator which installs as a windows printer. It looks to be open-source right now but I recall that we would have had to pay to use it in corporate environment.
Good Luck.
Use the tutorial How to use PowerBuilder to create PDF file?.

SQL in an e-mail app

I would like to be able to perform SQL queries on my e-mail inbox. With the output, I can make graphs about how much e-mails I send or receive for example. I want to analyze my performance and what keeps me busy. My mailbox seems like a good place to start.
I'm using Gmail on-line, and Thunderbird, Outlook 2007 and Mail.app trough IMAP. Is there an easy way how I can connect one of those apps with something I can SQL to?
Allready tried:
Thunderbird does not have an add-on for this (or I couldn’t find it).
I suspect Outlook to be able to do something together with MS Access, but I wouldn't know how.
None of my client seems to be able to export everyting to something useful, like CVS or Excel's .xls. From there on, I can import to Access and done.
UPDATE: Access 2007 does have a wizard on connecting to outlook. But when I run it, Office starts for no reaston to complain that Outlook 2007 is not found (?).
UPDATE 2: You can fix this by setting Outlook as the default e-mail client, closing outlook and starting it again.
You can simply connect Outlook to Access via Access Wizards or code (http://support.microsoft.com/kb/209946/en-us)
You can parse mbox files (which Thunderbird uses to store it's messages) using any number of scripts like this then do any sql on the messages you like.
I agree with stalepretzel, you should probably make your own if you can't find any ready-to-go package.
What I'd do is:
Download the messages using IMAP.
Parse them and insert into your database
You could make good use of the mess822 software package to parse the mail headers, then use that to populate a database.
I think a lot of script languages (perl, python) have similar libraries (probably for IMAP as well) and should be fairly easy to hack together.
I suggest making your own addon. I'm not familiar with Thunderbird addons (and I've only dabbled in FF ones), but I assume they're like FF addons in that if you know Javascript your well on your way. I would research Thunderbird addons, and create one that runs an AJAX script whenever it receives a message. That AJAX could contact a PHP script (which you'd need to run on something like Apache, possibly just on your home computer). This PHP script, in turn, would interpret the data that Thunderbird's Javascript sent, and enter that into a database.