shikhov
3/10/2018 - 1:21 PM

[Test] #LotusScript

[Test] #LotusScript

	'''''''''''''''''''''''''
	tmp = Environ("Temp")
	Set doc = source.Document
	If doc.HasEmbedded Then		
		Forall item In doc.Items
			If item.type = Attachment Then
				Set emb = doc.GetAttachment(item.values(0))
				If Right(Lcase(emb.source), 4) = ".jpg" Or Right(Lcase(emb.source), 5) = ".jpeg" Then
					'filepath = tmp + "\" + emb.source
					'Call emb.ExtractFile(filepath)
					Call emb.remove
					Set msgBody = doc.GetFirstItem("Body")
					Call msgBody.Embedobject(EMBED_ATTACHMENT, "", "D:\test_mod.jpg")
				End If
			End If
		End Forall
		Call doc.save(True, True)
	End If
	'''''''''''''''''''''''''