> But I want to open a new Browser to view the page, so I don't
> use WebPagePreview.
>
> --
> Message posted via http://www.officekb.com
Hi Michelle,
The more I look at it, the less I understand why your code doesn't work...
Maybe you can use the Shell function with iexplore.exe instead of
FollowHyperlink.
It seems messy since you have to figure out the full path to the IE program
(... if I didn't miss something obvious).
And the method doesn't work with other browsers :-(
See code below...
Klaus
Dim strProgramFilesDir As String
strProgramFilesDir = System.PrivateProfileString("", _
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", _
"ProgramFilesDir")
Dim strIE As String
strIE = System.PrivateProfileString("", _
"HKEY_LOCAL_MACHINE\Software\Microsoft\IE Setup\Setup", _
"Path") & _
"\iexplore.exe"
strIE = Replace(strIE, "%ProgramFiles%", strProgramFilesDir, , , vbTextCompare)
Dim strShell As String
strShell = strIE
Dim Path, Name, fullPath As String
Dim fullPath2 As String
With Dialogs(wdDialogFileSaveAs)
If .Display Then
Path = WordBasic.FileNameInfo(.Name, 5)
Name = WordBasic.FileNameInfo(.Name, 4)
fullPath = Path & Name & ".html"
ActiveDocument.SaveAs FileName:=fullPath, FileFormat:=wdFormatHTML, _
LockComments:=False, Password:="", AddToRecentFiles:=False,
WritePassword _
:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False,
SaveAsAOCELetter:= _
False
' ActiveDocument.FollowHyperlink fullPath
strShell = strShell & " " & Chr(34) & fullPath & Chr(34)
Shell strShell, vbNormalFocus
End If
End With