Can LotusScript be used to import a picture into a document so that when the document is opened you see the both the picture (not just a link) and the other information on the document?
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
Of course! Here's a snippet:
Dim nudCurrent As NotesUIDocument Dim sFilename As String Dim iTempCount As Long Dim sTemp As String Dim sFileExtension As String Dim wsCurrent As New NotesUIWorkspace Set nudCurrent = wsCurrent.CurrentDocument sFilepath = Input$("Enter the file path:") sFilename = Input$("Enter the filename to import:") 'Get extension If Instr(sFilename, ".") > 0 Then iTempCount = 1 sTemp = Right$(sFilename, iTempCount) While Left$(sTemp, 1) <> "." iTempCount = iTempCount + 1 sTemp = Right$(sFilename, iTempCount) Wend sFileExtension = Right$(sFilename, iTempCount - 1) Else sFileExtension = "" iTempCount = 0 End If sFileExtension = Ucase$(sFileExtension) If (sFileExtension = "JPG" Or sFileExtension = "GIF" Or sFileExtension = "CGM" Or sFileExtension = "BMP") Then Call nudCurrent.GotoField("Body") ?a RT Field Select Case sFileExtension Case "JPG": sFiletype = "JPEG Image" Case "GIF": sFiletype = "GIF Image" Case "CGM": sFiletype = "ANSI Metafile" Case "BMP": sFiletype = "BMP Image" Case Else sFileType = "ASCII Text" End Select Call nudCurrent.Import(sFiletype, sFilepath & "\" & sFilename)
As you can see the hard part is getting the file name and type.
Dig Deeper on LotusScript
Related Q&A from Todd Fuder
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.