dominoExperts.com - Powered by Domino 8.5.2 Domino Accelerator Pack
- Take load off your Domino server
Lotus Triple Search DominoExperts + Blogs + R8 forum
dominoExperts.com -> Script vault -> Lotus Script

 Problem creating specific OLE objects - why?


Niklas WallerPost date: 2007-10-11 16:43

Hi everybody,

I have an agent that acts on selected documents in a view (got this
from a colleague who found it in some forum).
For each document it shall print the document and its attachments. The agent works fine if the attachments are of type word (.doc). I would like it to work for pdf, txt, rtf and possible other formats as well. However I can't get a grip on the OLE classes.

I try to use them as they are stated in Domino Designer (I have looked in the windows registry as well) and it only generates the error "Cannot create automation object" whenever I use the CreateObject method. No such error is raised when I am creating an object for the OLE class "Word.Application". "Excel.Application" also works fine.

I have tried several different suggestions that I've found on developerworks and here is the latest try. I also tried the OLE class "AcroExch.Document" which is commonly suggested in the forums. When I try to use "AcroPDF.PDF" Notes crashes/dies.

The attached file contains the agent content. The problem occurs on the first line in "case pdf:", that is when the "CreateObject" is called.

There should be some logic in this and I'm sure there this. Can someone explain it to me. Any suggestion and help is appreciated!

Kind regards / Niklas

 

 


printDocuments.txt
Tomas NielsenPost date: 2007-10-13 15:18

I have tried parts of your code and get the same result.

I found some code on Adobes site that was for VB and get the same result. http://www.adobe.com/devnet/acrobat/pdfs/VBJavaScript.pdf

I am using Adobe 7 and Notes 7. Maybe Adobe has changed something since old code from the Internet does not seem to work anymore.


Niklas WallerPost date: 2007-10-18 18:42

I just wanted to tell you that I have found a solution to this that is even better. It prints all possible  attachments without needing to specify them all by shelling windows applications (as long as they are not strange or lack file extensions). Have a look at my blog for details.




RSS feed
Subscribe to Forum

Share this page

Top posters
Tomas Nielsen212
Joacim Boive27
Fredrik Stöckel27
Danne14
Niklas Waller13
Kenneth Haggman11
Bryan Kuhn10
Daniel Lehtihet9
Jonas Israelsson8
dm997