J
jennifer
I have a macro that opens an HTML file and then saves it as a Word
doc. I'm trying to bypass to dialogs that require user input, but I
haven't figured out how.
The first one occurs when the macro opens the file, and says "some of
the files in this web page aren't in the expected location. do you
want to download them anyway" - the answer should always be "yes".
Here's the code I used to open the file:
Documents.Open FileName:="objectref.html",
ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", Revert:=False,
WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
The second one occurs when the macro attempts to save the file from
html to doc. It reads: "some of the features in this document aren't
supported by Microsoft Internet Explorer 4.0 and Netscape Navigator
4.0". The feature its complaining about is linked style sheets. I
just want to tell this dialog to "continue". Here's the code to save
the file:
fname$ = ActiveDocument.Name
If InStr(1, fname$, ".") > 0 Then
fname$ = Left$(fname$, InStr(1, fname$, ".") - 1)
End If
myFileName$ = ActiveDocument.Name
newFileName$ = fname$ + ".doc"
ActiveDocument.SaveAs FileName:=newFileName$,
FileFormat:=wdFormatDocument
I'm using Word XP. Any help would be appreciated!
doc. I'm trying to bypass to dialogs that require user input, but I
haven't figured out how.
The first one occurs when the macro opens the file, and says "some of
the files in this web page aren't in the expected location. do you
want to download them anyway" - the answer should always be "yes".
Here's the code I used to open the file:
Documents.Open FileName:="objectref.html",
ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False,
PasswordDocument:="", _
PasswordTemplate:="", Revert:=False,
WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
The second one occurs when the macro attempts to save the file from
html to doc. It reads: "some of the features in this document aren't
supported by Microsoft Internet Explorer 4.0 and Netscape Navigator
4.0". The feature its complaining about is linked style sheets. I
just want to tell this dialog to "continue". Here's the code to save
the file:
fname$ = ActiveDocument.Name
If InStr(1, fname$, ".") > 0 Then
fname$ = Left$(fname$, InStr(1, fname$, ".") - 1)
End If
myFileName$ = ActiveDocument.Name
newFileName$ = fname$ + ".doc"
ActiveDocument.SaveAs FileName:=newFileName$,
FileFormat:=wdFormatDocument
I'm using Word XP. Any help would be appreciated!