locked
VBA send document to Web Serice RRS feed

  • Question

  • User-120760706 posted

    Hi,

    I am writing a C# 3.5 MVC web application, with MS Office and SQL 2008.

    Situation:  
    I need users to download a MS Word document from a web application,  Edit it, then upload it back to the web applicaiton.


    Ideal Solution:
    Instead of making the user log back into the web app find the correct document they are editing and upload it again. I would like it to work similar to how SharePoint 2007 works.

    I.e The user checks out the document on the server, so others are locked out of it (I can do this using server side code easily)
    I then want the user to press save which will automatically use HTTP post to send the Binary version of the MS word document to the server which will save it (again the server side code for this is easy)

    My VBA Questions

    1) How can I use VBA code in the word document to send the saved document back to the server? I have looked at the WebServices toolkit and can see XMLHTTP object, but I am not sure if this works with binary data or just XML. Each search web search on the topic referes to older technology like  SOAP Toolkit 3.0 and XMLHTTP3.0  what is the latest recommened way of doing this?


    2)  I would need some paramaters to pass back in with the POST to the serve such as the   UserID and DocumentID.   How can I achive this?  Can I use .NET code some how during the download to embed this information in the file some how (Prefeibily not the filename itself). So where the user cannot change it, In a hidden field? Meta data or VbA code? Can I edit VBA code using my Web App Server side code at run time?

    p.s.  I need a cross platform solution so writing dynamic FTP scripts is probably out of the question

    I have also posted this question here
    http://www.vbaexpress.com/forum/showthread.php?p=193712

    and in the getting started .net forum

    Sunday, August 30, 2009 9:01 PM

All replies

  • User-1659704165 posted

    Hi,

    Uplaoding(FTP) File using VBA..

    http://www.bygsoftware.com/Excel/VBA/ftp.htm

    http://www.dailydoseofexcel.com/archives/2006/01/29/ftp-via-vba/

    Chk teh abovelink

    Monday, August 31, 2009 12:14 AM
  • User-120760706 posted

    Thanks I have seen these post already, they both seem to create a .BAT file (WINDOWS ONLY) an execute it. I do not belive this option would work on Office for Apple Macs? (even though VBA does not work on Office 2008 for mac the new version of office will support VBA)

    Using FTP would also require the end users firewall is configured to allow FTP connections, I would much prefer a HTTP TCP/IP only solution if possible.  This also had the advantage of proding a sucess, failure message back to the client.

    Is there any other sugestions?

    Monday, August 31, 2009 1:05 AM