<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.blackbaud.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>VBA/API</title><link>http://forums.blackbaud.com/forums/20.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Debug Build: 20611.960)</generator><item><title>Re: Removing Addresses</title><link>http://forums.blackbaud.com/forums/thread/38023.aspx</link><pubDate>Thu, 13 Nov 2008 11:15:37 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:38023</guid><dc:creator>Mike Diplock</dc:creator><slash:comments>0</slash:comments><comments>http://forums.blackbaud.com/forums/thread/38023.aspx</comments><wfw:commentRss>http://forums.blackbaud.com/forums/commentrss.aspx?SectionID=20&amp;PostID=38023</wfw:commentRss><description>&lt;p&gt;Thanks David,&lt;/p&gt;
&lt;p&gt;You are right that in that using the object directly does work. The documentation for VBA says there are two ways to remove a child from a collection, with the collection item number or the object. I have always used the item number on other collections and didn&amp;#39;t realise the object removal existed. For those interested the working code is:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Dim oRec As CRecord, oConsAdds As CConstitAddresses, oAddr as CConstitAddress&lt;br /&gt;Set oRec = New CRecord&lt;br /&gt;oRec.Init moSC&lt;br /&gt;oRec.Load 1605&lt;br /&gt;Set oConsAdds = oRec.Addresses&lt;br /&gt;Set oAddr = oConsAdds.Item(1)&lt;br /&gt;oConsAdds.Remove oAddr,True&lt;br /&gt;oRec.Save&lt;br /&gt;oRec.CloseDown&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Re: Removing Addresses</title><link>http://forums.blackbaud.com/forums/thread/37942.aspx</link><pubDate>Sun, 09 Nov 2008 18:19:31 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:37942</guid><dc:creator>David Zeidman</dc:creator><slash:comments>0</slash:comments><comments>http://forums.blackbaud.com/forums/thread/37942.aspx</comments><wfw:commentRss>http://forums.blackbaud.com/forums/commentrss.aspx?SectionID=20&amp;PostID=37942</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;So I am not quite sure this is correct. The line &lt;/p&gt;&lt;p&gt;&lt;code&gt;oConsAdds.Remove 1,True&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Will not work as you expect. The&amp;nbsp; 1 is the address id. Alternatively you need to supply the actual CConstitAddress object and that will work.&lt;/p&gt;&lt;p&gt;&amp;nbsp;David &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Removing Addresses</title><link>http://forums.blackbaud.com/forums/thread/37941.aspx</link><pubDate>Sun, 09 Nov 2008 12:58:16 GMT</pubDate><guid isPermaLink="false">f90a95a0-00e2-4810-8af8-0bbdde08f853:37941</guid><dc:creator>Mike Diplock</dc:creator><slash:comments>0</slash:comments><comments>http://forums.blackbaud.com/forums/thread/37941.aspx</comments><wfw:commentRss>http://forums.blackbaud.com/forums/commentrss.aspx?SectionID=20&amp;PostID=37941</wfw:commentRss><description>&lt;p&gt;Has anyone successfully removed an address from a constituent using VBA? I am tidying up records after an import and am trying to remove lots of empty address fields using a plug-in written in VB6. I&amp;#39;m reasonably experienced in writing plug-ins but CConstitAddresses does not seem to be behaving the same as other RE collections like CConstituentCodes.&lt;/p&gt;
&lt;p&gt;The code is:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Dim oRec As CRecord, oConsAdds As CConstitAddresses&lt;br /&gt;Set oRec = New CRecord&lt;br /&gt;oRec.Init moSC&lt;br /&gt;oRec.Load 1605&lt;br /&gt;Set oConsAdds = oRec.Addresses&lt;br /&gt;oConsAdds.Remove 1,True&lt;br /&gt;oRec.Save&lt;br /&gt;oRec.&lt;/code&gt;&lt;code&gt;CloseDown&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;This should remove the first address from constituent &amp;#39;1605&amp;#39; but nothing happens when the code runs. Has anyone tried something similar with success?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>