Word 2003 automation

Posted on 2005-04-12
Last Modified: 2010-05-02
Hi I am using VB6 and Word 2000 and the code below to automate the opening and saving of a Doc into a html file ... will thsi work the same when i upgraded from word 2000 to word 2003 ??

I will update my refernec ocorse to word 2003 in VB but will this code still work as i need to now before i upgrade !

******************** code ***********************
Dim Appword As Word.Application
Set Appword = CreateObject("Word.Application")
Appword.Documents.Open ("F:\docs\" & docname & ".doc")
strHTML = Replace("F:\docs\" & docname & ".doc", ".doc", ".html")
Appword.ActiveDocument.SaveAs strHTML, FileFormat:=wdFormatHTML


Also i have been told there is a "save a webpage filtered" optionion in word 2003 which would be useful is this just a property i need to set when saving using teh automation above ??


Question by:itimes
    LVL 5

    Accepted Solution


    your code works fine on my pc VB6 + Office2003
    as a rule Visual basic will upgrade referaces and components to newer one automatically (it is an option in project property)

    regarding "save a webpage filtered" I don't know if you mean "wdFormatFilteredHTM" ,if so this save parameter is available in officexp,office2003 ,,, and it might be in office2000 cause I don't have this version of office installed to check it out

    when you save your document using wdFormatFilteredHTM parameter ,word saving your file into single htm file ( this the deferance which I have recognized)


    Author Comment


    Thanks you for the answers ... Great help !!



    Author Comment

    fadloun ,

    Im having a few problems when i uise the wdFormatFilteredHTM parameter, teh html produced has corruption at trhough out the document ... is this dues to settings in word i need to change ??

    It works fine if i save teh doc manully through word as web page filtred ?!?!

    If you wont me to ask this as a question for points let me know !!


    Author Comment


    Its all working fine now ... i recorded a macro in word saving a file as filtered htm and tehn used teh properties it sets in my vb prog and its works fine now ... must be one of teh properties that stops teh coruption !!!


    LVL 5

    Expert Comment

    Glad to know that everything is ok now

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now