1

I am trying to automate the opening of an excel file located in a jobs database within lotus notes. I have been able to open up a window in lotus notes using the url, but I can't open the file located there automatically as it is an attachment.

This is the vba code I am using to open the link:

Application.ActiveWorkbook.FollowHyperlink Address:="Notes://URL", NewWindow:=True

What is the proper way to do it?

sashkello
  • 17,306
  • 24
  • 81
  • 109
user1545751
  • 11
  • 1
  • 3

1 Answers1

1

You'll need to use VBA to access Lotus Notes via COM. Then you can get at the NotesEmbeddedObject, save it using the ExtractFile method, and then launch that saved copy.

An example of VBA using Notes COM API: http://www.vbafin.com/Lotus-Notes-VBA-code.php

There's a document on IBM's site that will help you get started:

How to use LotusScript classes with Visual Basic

Ken Pespisa
  • 21,989
  • 3
  • 55
  • 63
  • Sorry I was mistaken, it is actually an attachment within a lotus notes database not an embedded object. Would this require a similar method or does this make things more simple? – user1545751 Jul 23 '12 at 13:14
  • 2
    The NotesEmbeddedObject class actually includes both regular file attachments and OLE embedded objects. You can only use the Activate method for OLE, so in order to open the file into Excel you will have to use the ExtractFile method to save a temporary copy on disk and then open the temporary copy. – Richard Schwartz Jul 23 '12 at 14:43
  • @rhsatrhs, thanks, I wasn't 100% sure if that Activate method would work. – Ken Pespisa Jul 23 '12 at 15:29