Friday, June 4, 2010

OTA - Add Attachments into QC

'TestName The name of the test where the attachment needs to be saved
'LocalFilePath The path to the document that needs to be uploaded
'FileDescription A description of the document, stored in the description field
'TestObj : QC Object that is created.


Public Sub SaveAttachmentToTestObj(TestObj, LocalFilePath, FileDescription)
Set Attachments = TestObj.Attachments
Set Attachment = Attachments.AddItem(Null)
Attachment.FileName = LocalFilePath
Attachment.Description = FileDescription
Attachment.Type = 1'TDATT_FILE
Attachment.Post ' Commit changes
End Sub

' This function saves an attachment to the current test (the test must be existing on TestDirector).
' LocalFilePath: Path indicating the location of the attachment on the local filesystem
' FileDescription: Description of the file (Description field on TestDirector)

Public Function SaveAttachment(LocalFilePath, FileDescription)
SaveAttachmentToTestObj QCUtil.CurrentRun, LocalFilePath, FileDescription
End Function


1 comment:

Anonymous said...

Thanks a lot