Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27036

VS 2010 Make Word save file as "Web Page, Filtered"

$
0
0
I am using MS Word's ability to save a file in HTML format to create a very basic website CMS system. Files must be saved with a .htm extension in the "Web Page, Filtered" file format that is available in Word 2007 and 2010 (not sure about earlier versions). My VB program is used to remove some unwanted tags from the files and then transfer them to the website via FTP. I thought it would be neat to initiate the editing of a file from my program, so I used ProcessStartInfo to "shell" to "winword.exe" and open the file for editing. All good so far; the problem is if the user clicks "close" in Word and answers "yes" to the "save changes?" question, the file is saved in "normal" HTML format, not the Filtered version that I need. The resulting file is bloated with Word junk which I don't want.

So, is there any way to force Word to save in my desired "Web Page, Filtered" format? If it can't be done with a "shell" process, could it be done with Word Automation? I have seen mention of a "winword control"; could something like that be made to work?

Any ideas appreciated.

Viewing all articles
Browse latest Browse all 27036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>