Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically open a PDF, locate heading, and save heading as subject

Status
Not open for further replies.

kaatjev

Technical User
Jan 28, 2005
14
US
I have reports that I have sent to me in an e-mail which I then need to forward to vendors. The reports are e-mailed in PDF format. The subject line of the e-mail is always the same and there is no way (at this time) to change the software to change the subject line by vendor. The only way to extract this report is to e-mail myself and then e-mail the vendors.

From within the software that generates the report I can change the heading on the report itself - i.e. the heading that appears within the PDF itself, but the heading will not show on the e-mail subject line and as I said, no way to change the subject line portion.

When I generate the reports I generate approximately 500 of them at the same time. I then have to open each e-mail, open the PDF, change the subject line of the e-mail to match the heading of the report, close the PDF, close the e-mail, then send the e-mail to the vendor.

I would like to automate the above process. I have been reviewing some code and posts on this forum, and from what I have read, I would need to take the following steps.

1. automatically open the e-mail
2. automatically open the attachment
3. use pdfgrabber to convert to ascii or word
4. extract the header out of this ascii or word file
5. change the subject line to match the header
6. close the attachment
7. close the e-mail
8. locate the vendor in my contacts based on the subject line
9. send the e-mail to the vendor

I believe steps 1, 2, 5, 6, 7 and 9 are within my current capabilities even though I am a novice. I specifically need help with 3, 4, 8.

However, before I spend time on this, can someone help verify that I am not missing any steps in my thinking, or that it's even possible to handle 3 and 4 automatically?

Also, I don't know if this is against forum protocol, but I'd be willing to entertain quotes for someone to write the code I need to make this happen.

The above process is extremely tedious and I know it's possible to automate it. I appreciate any assistance I can get. Thank you.

Vianne
 
Hi Vianne,

Can you insert the report heading into the body of the email message (eg as the first or last line)? If so, automating the copying of the report heading from the message body to the email header shouldn't be too difficult.

Cheers
PS: you don't say what email client you're using - that could make a significant difference.

[MS MVP - Word]
 
No - it is not possible to put the report heading into the body of the message. it sends an e-mail with subject "Buy Detail Report" and attaches a PDF file named "Buy Detail Report". The heading is only in the actual PDF.

I am using outlook 2007.
 
Hi Vianne,

Depending on how the pdf-creation software works, you may find you can extract the report heading from the file's properties - specifically, the document's title or subject. That would avoid the need to parse the file. A command line tool for this is pdfinfo.exe (available from See for an Excel implementation.

Cheers

[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top