A
Alan
Hi All,
I am trying to write a fairly simple search and replace piece of code
that I will expand later to do multiple search / replaces, but I
cannot get it to work on just one even!
The code is below, and it gives a 'Permission Denied' error (70) on
the final line before the 'End Sub'.
The active document is a single HTML document, saved on my hard disk.
I can do a search / replace / save manually no problem so I don't
think it is a file permissions issue in Windows.
Any help is much appreciated - I am a newbie with FP VBA so please be
gentle!
Alan.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Sub Test()
Dim objPage As DispFPHTMLDocument
Dim strFind As String
Dim strReplace As String
Dim strTest As String
Set objPage = ActiveDocument
strFind = "/abc.nsf"
strReplace = "http://www.mydomain.com/abc.nsf"
strTest = Replace(objPage.DocumentHTML, strFind, strReplace)
' This next line errors with permission denied,
' yet the HTML file is on my HDD
objPage.DocumentHTML = strTest
End Sub
I am trying to write a fairly simple search and replace piece of code
that I will expand later to do multiple search / replaces, but I
cannot get it to work on just one even!
The code is below, and it gives a 'Permission Denied' error (70) on
the final line before the 'End Sub'.
The active document is a single HTML document, saved on my hard disk.
I can do a search / replace / save manually no problem so I don't
think it is a file permissions issue in Windows.
Any help is much appreciated - I am a newbie with FP VBA so please be
gentle!
Alan.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Sub Test()
Dim objPage As DispFPHTMLDocument
Dim strFind As String
Dim strReplace As String
Dim strTest As String
Set objPage = ActiveDocument
strFind = "/abc.nsf"
strReplace = "http://www.mydomain.com/abc.nsf"
strTest = Replace(objPage.DocumentHTML, strFind, strReplace)
' This next line errors with permission denied,
' yet the HTML file is on my HDD
objPage.DocumentHTML = strTest
End Sub