<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adding Attachments using VB code in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/adding-attachments-using-vb-code/m-p/3466308#M11943</link>
    <description>&lt;P&gt;I dont care about the excel auotmation Part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a file : EngDwg1.dwf in vault and have a file EngDwgAttach.dwf in vault also (I am not adding the file its already present in vault) , i also know the path where this file is located.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need a VB Call which will attach EngDwgAttach.dwf to EngDwg1.dwf .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 May 2012 19:40:18 GMT</pubDate>
    <dc:creator>shashipatra</dc:creator>
    <dc:date>2012-05-21T19:40:18Z</dc:date>
    <item>
      <title>Adding Attachments using VB code</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/adding-attachments-using-vb-code/m-p/3459916#M11941</link>
      <description>&lt;P&gt;Is there a way to&amp;nbsp;do the attachments using the VB code .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Manual Method :&lt;/P&gt;&lt;P&gt;First I select the File i want to add attachment.&amp;nbsp;Then under&amp;nbsp;Action Menu - &amp;gt; Attachments&lt;/P&gt;&lt;P&gt;I get two options to Attach and Detach. I can choose Attach option and select the File to attach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AutoMated way Required :&lt;/P&gt;&lt;P&gt;I&amp;nbsp;have a Excel File in the following format&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data looks like this&lt;/P&gt;&lt;P&gt;FileName&amp;nbsp;&amp;nbsp;&amp;nbsp; Attachment&lt;/P&gt;&lt;P&gt;456224&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MfgAtt1&lt;/P&gt;&lt;P&gt;456225&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MfgAtt2&lt;/P&gt;&lt;P&gt;456226&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MfgAtt3&lt;/P&gt;&lt;P&gt;456227&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MfgAtt4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the Files and attachment files are already present in Vault.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need Programatcially find the File and do the attachment .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2012 15:40:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/adding-attachments-using-vb-code/m-p/3459916#M11941</guid>
      <dc:creator>shashipatra</dc:creator>
      <dc:date>2012-05-16T15:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Attachments using VB code</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/adding-attachments-using-vb-code/m-p/3466220#M11942</link>
      <description>&lt;P&gt;Hi shashipatra,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sounds like you'd like to write a program that iterates though the data in the excel file and creates these attachments for you. I'm not too familiar with programming with excel files, but I can hopefully give you some guidance on the Vault side of things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, you want to know how to find the files identified in the Excel file.&amp;nbsp;The DocumentService.FindFilesBySearchConditions() can be used to search for files that meet certain search criteria. An example how of to use it can be found as part of the SDK install. Look at the VaultFileBrowser sample's FinderForm.cs (or .vb) for an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Secondly, you need to create new attachments for these files. You can add you're own attachments programmatically using the DocumentService.CheckinFile() method that is part of the Vault SDK. To add an attachment to a file, first check out the file, then check it back in after adding a new FileAssocParam to the associations array. The new FileAssocParam should have a type of attachment and the child file property should point to the file you wish to attach. More information on the CheckinFile() method and its parameters can be found in the SDK documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some additional information on attachments can also be found here: &lt;A href="http://justonesandzeros.typepad.com/blog/2010/11/attachments-and-dependencies-faq.html" target="_blank"&gt;http://justonesandzeros.typepad.com/blog/2010/11/attachments-and-dependencies-faq.html&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2012 18:48:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/adding-attachments-using-vb-code/m-p/3466220#M11942</guid>
      <dc:creator>Daniel.Dulzo</dc:creator>
      <dc:date>2012-05-21T18:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Attachments using VB code</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/adding-attachments-using-vb-code/m-p/3466308#M11943</link>
      <description>&lt;P&gt;I dont care about the excel auotmation Part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a file : EngDwg1.dwf in vault and have a file EngDwgAttach.dwf in vault also (I am not adding the file its already present in vault) , i also know the path where this file is located.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need a VB Call which will attach EngDwgAttach.dwf to EngDwg1.dwf .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2012 19:40:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/adding-attachments-using-vb-code/m-p/3466308#M11943</guid>
      <dc:creator>shashipatra</dc:creator>
      <dc:date>2012-05-21T19:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Attachments using VB code</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/adding-attachments-using-vb-code/m-p/3469258#M11944</link>
      <description>&lt;P&gt;You should use the DocumentService.CheckinFile() method to add an attachment to a file. Follow the steps below to create the attachment:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;check out EngDwg1.dwf with DocumentServices.CheckoutFile()&lt;/LI&gt;
&lt;LI&gt;get the existing file relationships for EngDwg1.dwf via DocumentServices.GetFileAssociationsByIds()&lt;/LI&gt;
&lt;LI&gt;check in EngDwg1.dwf via DocumentServices.CheckinFile()&amp;nbsp;using&amp;nbsp;an array of the file associations including both the old file associations and the new file association of the EngDwgAttach.dwf as an attachment&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 23 May 2012 15:35:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/adding-attachments-using-vb-code/m-p/3469258#M11944</guid>
      <dc:creator>Daniel.Dulzo</dc:creator>
      <dc:date>2012-05-23T15:35:03Z</dc:date>
    </item>
  </channel>
</rss>

