• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

Word 2003 automation

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
Appword.ActiveDocument.Close
Appword.Quit

*************************************************

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 ??

Thanks

IT
0
itimes
Asked:
itimes
  • 3
  • 2
1 Solution
 
fadlounCommented:
hello

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)

regards
0
 
itimesAuthor Commented:
fadloun,

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

Thanks

IT
0
 
itimesAuthor Commented:
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 !!

0
 
itimesAuthor Commented:
fadloun,

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 !!!

Thanks

IT
0
 
fadlounCommented:
Glad to know that everything is ok now
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now