Showing results for 
Search instead for 
Do you mean 

Create History with File Attachment

Copper Super Contributor
Posts: 88
Country: USA

Create History with File Attachment



I want to be able to create a new History record for a Contact, and add an Attachment at the same time. The attachment will be a WORD or PDF document, and will be in a Folder other than the ACT! Attachments folder (if possible).


I am able to get the Contact info in .NET - I just need to create the code to create the History record and add an Attachment reference in the History record.


I would appreciate any help available, and VB code samples if possible.





Copper Super Contributor
Posts: 112
Country: Australia

Re: Create History with File Attachment

It would be nice to be able to use Act.Framework.Histories.History, but the Act.Framework.SupplementalFiles.Attachment is protected so you cant create an attachment object!!!!!!!!!!!! (in 2011 it is)


inside i use something like this:

        Dim g(0) As Guid

        g(0) = ActApp.ActFramework.Contacts.GetMyRecord.ID

        Dim cl As Act.Framework.Contacts.ContactList = ActApp.ActFramework.Contacts.GetContactsByID(Nothing, g)


        ActApp.UIHistoryManager.AttachFile(cl(0), "Description Text", "C:\Path\Filename.txt")


you just need a CONTACT object, description text, and file info.. thats it

Bronze Elite Contributor
Posts: 2,119
Country: United_Kingdom

Re: Create History with File Attachment

Hiya guys,


Firstly let me say I haven't tested this so I might be talking out of my ****! Smiley Wink


To create an Attachment you could use the SupplementalFileManager (from ActFramework.SupplementalFileManager) to:


SupplementalFileManager sFM = oFram.SupplementalFileManager;

Attachment att = sFM.CreateAttachment(AttachMate.History,filePath, displayName, False); 


oFram.Histories.CreateHistory(contact, activityOccurID, histType, isPrivate, displayDate, endDate, regarding, details, att) ;


Let me know if I've got it all horribly wrong!

Vivek Gargav
Caldere Associates Ltd.
My Blog
Copper Super Contributor
Posts: 112
Country: Australia

Re: Create History with File Attachment

not sure now how i tried to create the attachments but at the time i didnt get it to work.. but vivek your code works fine.. (so does mine) so both ways work