Ben Langhinrichs

Photograph of Ben Langhinrichs

E-mail address - Ben Langhinrichs







Recent posts

Mon 21 Jun 2021

Custom Domino Extensions presentation



Thu 10 Jun 2021

Notes 12 without all the blue



Wed 5 May 2021

Pull public data into Notes on the fly


November, 2021
SMTWTFS
 01 02 03 04 05 06
07 08 09 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

Search the weblog





























Genii Weblog

Creating and modifying image resources with Midas 3.30

Thu 29 Apr 2004, 01:19 AM



by Ben Langhinrichs
While working on a new sample to be distributed with Midas version 3.30, I created this code for creating and modifying image resources with Midas Version 3.30.  It has gotten has gotten very simple.  Here is the whole agent for either creating or modifying an image resource:

Sub Initialize
   ' *** Domino back-end class objects
   Dim session As New NotesSession
   Dim db As NotesDatabase
   
   ' *** Midas back-end class objects
   Dim rtSession As New GeniiSession
   Dim rtitem As New GeniiRTItem
   
   ' *** Miscellaneous processing variables
   Dim fileName As String
   Dim pathName As String
   Dim pos As Integer
   
   Set db = session.CurrentDatabase
   
   pathName$ = Inputbox$("Enter the full pathname for the graphics file:", "Graphic Pathname", "")
   If Len(pathName) =Then Exit Sub
   
   fileName = pathName
   pos = Instr(fileName, "\")
   While pos > 0
      fileName = Mid$(fileName, pos+1, Len(fileName)-pos)
      pos = Instr(fileName, "\")
   Wend
   
   Set rtitem = rtSession.CreateImageResource(db.Server, db.FilePath, fileName, pathName)
   rtitem.Save
End Sub

By default, the CreateImageResource will overwrite the existing image resource, so this will either create or update the image resource.  Pretty simple, eh?

Copyright 2004 Genii Software Ltd.

What has been said:

No documents found