This function uploads the selected file to the question.
object.UploadFile
aFileName, aSource
Part | Attribute | Type | Description |
---|---|---|---|
object |
Required | The object always implements the
ISQuestion interface |
|
aFileName |
In, Required | string |
The name of the file to be uploaded |
aSource |
In, Required | The data stream that contains the body of the file
being added |
Upload the selected file to the question and display some information about it.
Dim aPatient
Dim aQuestions, aQuestion
Dim aMessage
Dim i
Dim aStream
Dim aFileName
Set aPatient = Profile.SelectPatient
set aQuestions = Profile.ProfileInternal.LoadQuestionsForPatient(aPatient.ID)
if aQuestions.Count = 0 then
Profile.MsgBox("No questions")
exit sub
end if
set aQuestion = aQuestions.Item(0)
aMessage = aMessage & vbNewLine &_
"Title: " & aQuestion.Title & vbNewLine &_
"Amend Date: " & aQuestion.AmendDate & vbNewLine &_
"Body: " & aQuestion.Body & vbNewLine &_
"Date: " & aQuestion.Date & vbNewLine &_
"Patient: " & aPatient.SurnameFirstName & vbNewLine &_
"Status: " & aQuestion.Status & vbNewLine &_
"Uploaded Files Count = " & aQuestion.GetUploadedFileCount & vbNewLine
set aStream = Profile.MakeStream
aFileName = "hello"
aStream.LoadFromFile("D:\documents\hello.docx")
aQuestion.UploadFile aFileName, aStream
aMessage = aMessage & vbNewLine & "The file '" & aFileName &_
"' was successfully uploaded to the question '" & aQuestion.Title & "'" &_
vbNewLine & vbNewLine & "Uploaded Files Count = " &_
aQuestion.GetUploadedFileCount & vbNewLine
Profile.MsgBox(aMessage)
In Profile Client v8 on User Interface Uploaded Files can be found in
.