M
Michelle via OfficeKB.com
I am writing the following code, it will popup a save as dialog, when I got the path and name info, i run ActiveDocument.SaveAs to save doc as webpage. After that, I tried to call ActiveDocument.FollowHyperlink to open that webpage, however, nothing happen.
But then, i tried to call ActiveDocument.FollowHyperlink to open a file which is saved before, it works fine.
I feel strange that if i just saved the file, i can't immediately call ActiveDocument.FollowHyperlink to view the page. Anyone can help?
Dim Path, Name, fullPath 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
End If
End With
But then, i tried to call ActiveDocument.FollowHyperlink to open a file which is saved before, it works fine.
I feel strange that if i just saved the file, i can't immediately call ActiveDocument.FollowHyperlink to view the page. Anyone can help?
Dim Path, Name, fullPath 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
End If
End With