Macro - Format Text / Save As HTML / Format Source 
Author Message
 Macro - Format Text / Save As HTML / Format Source

I have written a macro to format the text of Word
documents, it searches/replaces/sets fonts/styles etc

Next step is Save As HTML (File Menu)

But it is important for speed that the user can select
the path and filename for the reulting .htm file so I
want to do:

Dialogs(wdDialogFileSaveAs).Display (or even .show)

but for speed I want to set the file format ("Save As
Type") to "HTML Document"

After the user has entered the file name and path I want
to continue my macro/vb processes on the .htm file

I can do the first bit and the bit after saving as htm
but it is the Save As HTML I am stuck with.  Any ideas?

Thanks in advance
Paul



Sat, 17 Dec 2005 19:43:59 GMT  
 Macro - Format Text / Save As HTML / Format Source
Hi Paul,

Quote:
> But it is important for speed that the user can select
> the path and filename for the reulting .htm file so I
> want to do:

> Dialogs(wdDialogFileSaveAs).Display (or even .show)

> but for speed I want to set the file format ("Save As
> Type") to "HTML Document"

Getting the exact value is tricky, and I'm not sure it's
the same from machine to machine (probably is) or from
version to version (probably not). This works for me, here
(Word 2003 on WinXP)

Sub TestSetFileFormat()
    With Dialogs(wdDialogFileSaveAs)
        .Format = "8"
        .Show
    End With
End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)



Sat, 24 Dec 2005 22:40:34 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Word 97 SR-1 - Macro command for Application.SaveAs does not save in HTML format

2. Needed: Modul for writing formatted text to be saved in RTF - Format

3. Formatting and saving text as html

4. Saving HTML/rich format into HTML file

5. Macro to save html source

6. QB source saved in binary format!

7. save excel file as csv format as part of macro

8. Read HTML formatted data from database field, Insert Wordmerge fields, and save as Word document

9. Saving charts in HTML format using VBA

10. Can't save Word Document in HTML format

11. save excel file as csv format as part of macro

12. Binary format to text format form conversion

 

 
Powered by phpBB® Forum Software