<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Accessing WebDAV in Microsoft Word Visual Basic</title>
	<atom:link href="http://blog.itwarlocks.com/2009/04/28/accessing-webdav-in-microsoft-word-visual-basic/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.itwarlocks.com/2009/04/28/accessing-webdav-in-microsoft-word-visual-basic/</link>
	<description>Profession blog about Software Engineering, Web, *nix, Processes, Tools and more.</description>
	<lastBuildDate>Thu, 19 Aug 2010 19:39:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: steve</title>
		<link>http://blog.itwarlocks.com/2009/04/28/accessing-webdav-in-microsoft-word-visual-basic/comment-page-1/#comment-244</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Thu, 19 Aug 2010 19:39:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.itwarlocks.com/?p=45#comment-244</guid>
		<description>I was able to figure out how to rename files/directories using WebDav.  Here is some sample code.

origName is the original name that should be renamed.
parentPage is the full WebDAV path to where origName should be moved/renamed
newName is the new name for the file/folder
davFiles is an ADODB.RecordSet
davFile is an ADODB.Record

    Do While Not davFiles.EOF
        davFile.Open davFiles, , adModeReadWrite
            If origName = davFile.Fields(&quot;RESOURCE_PARSENAME&quot;).Value Then
                davFile.MoveRecord , parentPage &amp; newName
                davFile.Close
                davFiles.MoveLast
            Else
                davFile.Close       &#039; Always remember to Close the file!
                davFiles.MoveNext   &#039; Move the index to the next Record.
            End If
    Loop</description>
		<content:encoded><![CDATA[<p>I was able to figure out how to rename files/directories using WebDav.  Here is some sample code.</p>
<p>origName is the original name that should be renamed.<br />
parentPage is the full WebDAV path to where origName should be moved/renamed<br />
newName is the new name for the file/folder<br />
davFiles is an ADODB.RecordSet<br />
davFile is an ADODB.Record</p>
<p>    Do While Not davFiles.EOF<br />
        davFile.Open davFiles, , adModeReadWrite<br />
            If origName = davFile.Fields(&#8220;RESOURCE_PARSENAME&#8221;).Value Then<br />
                davFile.MoveRecord , parentPage &amp; newName<br />
                davFile.Close<br />
                davFiles.MoveLast<br />
            Else<br />
                davFile.Close       &#8216; Always remember to Close the file!<br />
                davFiles.MoveNext   &#8216; Move the index to the next Record.<br />
            End If<br />
    Loop</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffrey Ridout</title>
		<link>http://blog.itwarlocks.com/2009/04/28/accessing-webdav-in-microsoft-word-visual-basic/comment-page-1/#comment-159</link>
		<dc:creator>Jeffrey Ridout</dc:creator>
		<pubDate>Tue, 01 Jun 2010 11:45:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.itwarlocks.com/?p=45#comment-159</guid>
		<description>I started looking into the issue, but since I&#039;m running Windows 7 (x64) I keep getting:
-2147217895: Object or data matching the name, range, or selection criteria was not found within the scope of this operation.
This might be caused by new security restrictions, but I&#039;m not sure. If I find a solution I&#039;ll post it here.</description>
		<content:encoded><![CDATA[<p>I started looking into the issue, but since I&#8217;m running Windows 7 (x64) I keep getting:<br />
-2147217895: Object or data matching the name, range, or selection criteria was not found within the scope of this operation.<br />
This might be caused by new security restrictions, but I&#8217;m not sure. If I find a solution I&#8217;ll post it here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steve</title>
		<link>http://blog.itwarlocks.com/2009/04/28/accessing-webdav-in-microsoft-word-visual-basic/comment-page-1/#comment-120</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Tue, 20 Apr 2010 23:12:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.itwarlocks.com/?p=45#comment-120</guid>
		<description>&lt;a href=&quot;#comment-118&quot; rel=&quot;nofollow&quot;&gt;@steve &lt;/a&gt; 
I tried both approaches for renaming a directory (e.g. both using davFile.MoveRecord and davFiles.Update &quot;RESOURCE_PARSENAME&quot; &quot;NewName&quot;)  Both approaches generated unsupported errors.  Any suggestions?</description>
		<content:encoded><![CDATA[<p><a href="#comment-118" rel="nofollow">@steve </a><br />
I tried both approaches for renaming a directory (e.g. both using davFile.MoveRecord and davFiles.Update &#8220;RESOURCE_PARSENAME&#8221; &#8220;NewName&#8221;)  Both approaches generated unsupported errors.  Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steve</title>
		<link>http://blog.itwarlocks.com/2009/04/28/accessing-webdav-in-microsoft-word-visual-basic/comment-page-1/#comment-118</link>
		<dc:creator>steve</dc:creator>
		<pubDate>Tue, 20 Apr 2010 08:25:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.itwarlocks.com/?p=45#comment-118</guid>
		<description>Thanks for this excellent guide!  It has helped me tremendously integrating some VBA code with our Wiki (Confluence).  How could the above code be modified to rename an existing WebDAV directory?  

Would you recommend updating RESOURCE_PARSENAME and davFiles to perform an ADODB.Recordset update, or davFile and perform an ADODB.Record MoveRecord?

And for deleting a file/directory, would you simply find the davFile and use the ADODB.Record DeleteRecord function or would you use the davFiles ADODB.RecordSet Delete function?

I assume that taking the RecordSet approach in either of the above would require closing the davFile first.  Using davFile will require closing davFile after the move, but what about after a delete?  Does anything need to be done after calling davFile.DeleteRecord other than setting davFile = Nothing (although I notice you never set dirFile = Nothing like you do davFiles and davDir) -- is there still something to close after deleting the Record?</description>
		<content:encoded><![CDATA[<p>Thanks for this excellent guide!  It has helped me tremendously integrating some VBA code with our Wiki (Confluence).  How could the above code be modified to rename an existing WebDAV directory?  </p>
<p>Would you recommend updating RESOURCE_PARSENAME and davFiles to perform an ADODB.Recordset update, or davFile and perform an ADODB.Record MoveRecord?</p>
<p>And for deleting a file/directory, would you simply find the davFile and use the ADODB.Record DeleteRecord function or would you use the davFiles ADODB.RecordSet Delete function?</p>
<p>I assume that taking the RecordSet approach in either of the above would require closing the davFile first.  Using davFile will require closing davFile after the move, but what about after a delete?  Does anything need to be done after calling davFile.DeleteRecord other than setting davFile = Nothing (although I notice you never set dirFile = Nothing like you do davFiles and davDir) &#8212; is there still something to close after deleting the Record?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffrey Ridout</title>
		<link>http://blog.itwarlocks.com/2009/04/28/accessing-webdav-in-microsoft-word-visual-basic/comment-page-1/#comment-89</link>
		<dc:creator>Jeffrey Ridout</dc:creator>
		<pubDate>Thu, 11 Mar 2010 12:15:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.itwarlocks.com/?p=45#comment-89</guid>
		<description>&lt;a href=&quot;#comment-85&quot; rel=&quot;nofollow&quot;&gt;@NMTT&lt;/a&gt; Yes, listing 1 shows that the &lt;code&gt;open&lt;/code&gt; function takes a username and password parameter.</description>
		<content:encoded><![CDATA[<p><a href="#comment-85" rel="nofollow">@NMTT</a> Yes, listing 1 shows that the <code>open</code> function takes a username and password parameter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NMTT</title>
		<link>http://blog.itwarlocks.com/2009/04/28/accessing-webdav-in-microsoft-word-visual-basic/comment-page-1/#comment-85</link>
		<dc:creator>NMTT</dc:creator>
		<pubDate>Mon, 08 Mar 2010 16:01:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.itwarlocks.com/?p=45#comment-85</guid>
		<description>Hi. Great Help!

But if my Web Dav server requires basic authentication, how can I directly open a document without opening the windows authentication dialog?

Is there some Open Command with username and pass parameters?</description>
		<content:encoded><![CDATA[<p>Hi. Great Help!</p>
<p>But if my Web Dav server requires basic authentication, how can I directly open a document without opening the windows authentication dialog?</p>
<p>Is there some Open Command with username and pass parameters?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffrey Ridout</title>
		<link>http://blog.itwarlocks.com/2009/04/28/accessing-webdav-in-microsoft-word-visual-basic/comment-page-1/#comment-80</link>
		<dc:creator>Jeffrey Ridout</dc:creator>
		<pubDate>Thu, 25 Feb 2010 10:47:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.itwarlocks.com/?p=45#comment-80</guid>
		<description>&lt;a href=&quot;#comment-77&quot; rel=&quot;nofollow&quot;&gt;@Chad &lt;/a&gt; I’ve corrected a few typos and added an example document. I hope that helps.
As an added bonus, I’ve added a URLDecode function that will translate the title from URL. No more %20. (Supports åäâöéèêëóòô…)</description>
		<content:encoded><![CDATA[<p><a href="#comment-77" rel="nofollow">@Chad </a> I’ve corrected a few typos and added an example document. I hope that helps.<br />
As an added bonus, I’ve added a URLDecode function that will translate the title from URL. No more %20. (Supports åäâöéèêëóòô…)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad</title>
		<link>http://blog.itwarlocks.com/2009/04/28/accessing-webdav-in-microsoft-word-visual-basic/comment-page-1/#comment-77</link>
		<dc:creator>Chad</dc:creator>
		<pubDate>Tue, 23 Feb 2010 17:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.itwarlocks.com/?p=45#comment-77</guid>
		<description>I was interested to see how your code worked and how I might be able to leverage it for a project I&#039;m working on.  I copied Listing 3 above and dropped it into a module then created the UserForm shown.  However whenever I try to run the function it gives me that nasty little Object Expected error on the dlgOpenFileDAV.ListDocuments.Clear line.  Thinking perhaps that the form wasn&#039;t loaded I added that in above to no avail.  Whenever I try to  launch the UserForm it gives me the same error but on the line that reads davTest.isCancelled = True.  I can&#039;t seem to locate any definition for the davTest object.  What am I missing?</description>
		<content:encoded><![CDATA[<p>I was interested to see how your code worked and how I might be able to leverage it for a project I&#8217;m working on.  I copied Listing 3 above and dropped it into a module then created the UserForm shown.  However whenever I try to run the function it gives me that nasty little Object Expected error on the dlgOpenFileDAV.ListDocuments.Clear line.  Thinking perhaps that the form wasn&#8217;t loaded I added that in above to no avail.  Whenever I try to  launch the UserForm it gives me the same error but on the line that reads davTest.isCancelled = True.  I can&#8217;t seem to locate any definition for the davTest object.  What am I missing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffrey Ridout</title>
		<link>http://blog.itwarlocks.com/2009/04/28/accessing-webdav-in-microsoft-word-visual-basic/comment-page-1/#comment-66</link>
		<dc:creator>Jeffrey Ridout</dc:creator>
		<pubDate>Tue, 19 Jan 2010 14:46:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.itwarlocks.com/?p=45#comment-66</guid>
		<description>&lt;a href=&quot;#comment-62&quot; rel=&quot;nofollow&quot;&gt;@Steve&lt;/a&gt; 
I had to do a bit of testing and it might seem a bit odd, but here&#039;s how to create directories:

1. Open the parent directory as done in Listing 1.
2. Grab the RecordSet for the children, as in Listing 1, line 30.

Then create a new Record:
&lt;pre&gt;[code lang=&quot;vb&quot;]
If (davFiles.Supports(adAddNew)) Then
    Dim newDirFields(1) As Variant
    Dim newDirValues(1) As Variant
    newDirFields(0) = &quot;RESOURCE_PARSENAME&quot;
    newDirValues(0) = &quot;newdirname&quot;
    newDirFields(1) = &quot;RESOURCE_ISCOLLECTION&quot;
    newDirValues(1) = True
    
    davFiles.AddNew newDirFields, newDirValues
End If
[/code]&lt;/pre&gt;

Note that using AddNew moves the RecordSet to the end, thus EOF will be &#039;True&#039;.</description>
		<content:encoded><![CDATA[<p><a href="#comment-62" rel="nofollow">@Steve</a><br />
I had to do a bit of testing and it might seem a bit odd, but here&#8217;s how to create directories:</p>
<p>1. Open the parent directory as done in Listing 1.<br />
2. Grab the RecordSet for the children, as in Listing 1, line 30.</p>
<p>Then create a new Record:</p>
<pre class="brush: vb">
If (davFiles.Supports(adAddNew)) Then
    Dim newDirFields(1) As Variant
    Dim newDirValues(1) As Variant
    newDirFields(0) = &quot;RESOURCE_PARSENAME&quot;
    newDirValues(0) = &quot;newdirname&quot;
    newDirFields(1) = &quot;RESOURCE_ISCOLLECTION&quot;
    newDirValues(1) = True

    davFiles.AddNew newDirFields, newDirValues
End If
</pre>
<p>Note that using AddNew moves the RecordSet to the end, thus EOF will be &#8216;True&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://blog.itwarlocks.com/2009/04/28/accessing-webdav-in-microsoft-word-visual-basic/comment-page-1/#comment-62</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Mon, 11 Jan 2010 21:20:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.itwarlocks.com/?p=45#comment-62</guid>
		<description>This is excellent.  I have two questions:

1. How would one create a new directory on the WebDAV server using this interface?
2. How would one copy a file without using Documents.Open and ActiveDocument.SaveAs?

What I&#039;m trying to do is create code that will copy a WebDAV folder and all of its files to another WebDAV folder.  Using your code above, I can locate the folder and its contents, but I&#039;m lost as to how to create a new folder and copy the contents of the newly created folder.</description>
		<content:encoded><![CDATA[<p>This is excellent.  I have two questions:</p>
<p>1. How would one create a new directory on the WebDAV server using this interface?<br />
2. How would one copy a file without using Documents.Open and ActiveDocument.SaveAs?</p>
<p>What I&#8217;m trying to do is create code that will copy a WebDAV folder and all of its files to another WebDAV folder.  Using your code above, I can locate the folder and its contents, but I&#8217;m lost as to how to create a new folder and copy the contents of the newly created folder.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: blog.itwarlocks.com @ 2010-09-09 01:08:00 -->