I am setting up a form with a button for our employees to use to run an update on an internally developed program. The button will detach one or more files, which may or may not already exist on their machine. I would like to conceal the prompt to overwrite existing files, similar to using the DOS Copy command with the /Y switch. Is there anyway to do this? I am using a simple formula with the EditDetach command.
Thanks - Kurt
Subject: Concealing Overwrite Prompt
Assuming you know where the file will be:
Dim uiws as New NotesUIWorkspace
Dim rtItem as NotesRichTextItem
Dim eObj as NotesEmbeddedObject
'seek and, seek and destroy…
if Dir$(fileName$) = fileName$ then
'file exists - kill it -- this won't work if the file's in use at the time
kill fileName$
end if
'no file, no prompt. proceed with detaching.
'get the item with our file
Set rtItem = uiws.CurrentDocument.Document.GetFirstItem(itemWithFileToDetach$)
'get the file itself (in a notes embedded object)
Set eObj = rtItem.EmbeddedObjects(0)
'extract it to fileName$ (which should really be called filePath$)
Call eObj.ExtractFile(fileName$)