Re: How do you modify and save txt or xml file using FP VBA or via

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thomas, thank you for your time. I do have couple of more questions:

My FP Addin does have MS Scripting referenced, and i often use it to create
(client requested) report files that live on client's machine.

With settings that I currently have, following code fails at OpenTextFile
because the directory does not exist on my (client's) machine, while the
directory exists on the server:
Sub testFSO()
Dim oFSO As FileSystemObject
Dim oText As TextStream
Dim sServerFileSystemPath As String
sServerFileSystemPath = "C:\Data\webs\SomeSite\"
Set oFSO = New FileSystemObject
Set oText = oFSO.OpenTextFile(sServerFileSystemPath & "new_page_1.txt",
ForWriting, True)
oText.Write "Document Name: new_page_1.txt"
oText.Close
Set oText = Nothing
Set oFSO = Nothing
End Sub

Are you saing that there is a different way of using FSO so that it can
access (if permitted) files and folders on the server?

Are there any ideas on how to edit txt file open in FP in current view
without using FSO? Is it possible to use FP 6.0 Web and Page Object Models to
edit txt files?

"Thomas A. Rowe" wrote:

> If you have the site open in FP, and the server allows access to the filesystemobject, then it
> should work.
>
> --
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> ==============================================
> If you feel your current issue is a results of installing
> a Service Pack or security update, please contact
> Microsoft Product Support Services:
> http://support.microsoft.com
> If the problem can be shown to have been caused by a
> security update, then there is usually no charge for the call.
> ==============================================
>
> "Marko" <Marko@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:D9D9C2FA-B1E9-42A6-BE46-078F42DE5464@xxxxxxxxxxxxxxxx
> > Correct, but file sistem will access only files in the FP client environment.
> > I do not think that I can access filesystem of the FP server on which
> > "new_page_1.txt" would be located.
> >
> > "Thomas A. Rowe" wrote:
> >
> >> If you save the file to the filesystem (folder within the web) then there should be any problem
> >> with
> >> the user having access to the file.
> >>
> >> --
> >> ==============================================
> >> Thomas A. Rowe (Microsoft MVP - FrontPage)
> >> ==============================================
> >> If you feel your current issue is a results of installing
> >> a Service Pack or security update, please contact
> >> Microsoft Product Support Services:
> >> http://support.microsoft.com
> >> If the problem can be shown to have been caused by a
> >> security update, then there is usually no charge for the call.
> >> ==============================================
> >>
> >> "Marko" <Marko@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> news:2A5DAA53-D5FF-44E1-9483-BF6436DB5828@xxxxxxxxxxxxxxxx
> >> > Thanks for your reply Stefan.
> >> >
> >> > However this would not work, because I am not trying to save the file to
> >> > file system, but to an ActiveWeb.
> >> >
> >> > You agree that following would not work:
> >> > Set oText = oFSO.OpenTextFile("http://SomeSite/new_page_1.txt";, ForWriting)
> >> >
> >> > If I save the text file to File System, then I have to ask user to import
> >> > this file into the web. I think that there has to be a better way of doing
> >> > this.
> >> >
> >> > I can use
> >> > Set oWebFile = ActiveWeb.LocateFile("http://SomeSite/new_page_1.htm";)
> >> > oWebFile.open
> >> > to access ActiveDocument object of an HTM file "new_page_1.htm".
> >> >
> >> > My question is, how do I do this for "http://SomeSite/new_page_1.txt";?
> >> > Code:
> >> > Set oWebFile = ActiveWeb.LocateFile("http://SomeSite/new_page_1.txt";)
> >> > oWebFile.open
> >> > still works, but ActiveDocument returns nothing for TXT files.
> >> > How do I modify and Save this "new_page_1.txt" via VBA?
> >> >
> >> >
> >> >
> >> >
> >> > "Stefan B Rusynko" wrote:
> >> >
> >> >> See VBA help on FileSystemObject
> >> >>
> >> >> --
> >> >>
> >> >> _____________________________________________
> >> >> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> >> >> "Warning - Using the F1 Key will not break anything!" (-;
> >> >> To find the best Newsgroup for FrontPage support see:
> >> >> http://www.net-sites.com/sitebuilder/newsgroups.asp
> >> >> _____________________________________________
> >> >>
> >> >>
> >> >> "Marko" <Marko@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> >> news:97868884-F7C6-4D3E-B238-A3E68AE71E5A@xxxxxxxxxxxxxxxx
> >> >> | Working with htm or html extensions in VBA is no problem.
> >> >> | However, I can't find any help or examples on how to open, modify and save
> >> >> | txt file in VBA.
> >> >> | ActiveDocument returns nothing, so I am kind of stuck. Any ideas would be
> >> >> | appreciated.
> >> >> | My goal is not to save the file to C:/, but to a folder in a currently open
> >> >> | site.
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>
.



Relevant Pages

  • Re: How do you modify and save txt or xml file using FP VBA or via
    ... Yes, FSO is a Windows Server component, but requires access permission on server for a specific ... security update, then there is usually no charge for the call. ... > Dim oFSO As FileSystemObject ...
    (microsoft.public.frontpage.addins)
  • Re: unable to publish to local IIS
    ... Microsoft MVP - FrontPage ... "Thomas A. Rowe" wrote: ... Since you have a server, then is better to open and work ...
    (microsoft.public.frontpage.extensions.windowsnt)
  • Re: FP Search function
    ... Microsoft MVP - FrontPage ... "Thomas A. Rowe" wrote: ... them implement Search on a Linux/FP server? ...
    (microsoft.public.frontpage.programming)
  • Re: Multiple FP sites with same rootfolder
    ... "Thomas A. Rowe" wrote in message ... Microsoft MVP - FrontPage ... > I have a problem with a setup of Frontpage Server Extensions on a> Windows ...
    (microsoft.public.frontpage.extensions.windowsnt)
  • Re: unable to publish to local IIS
    ... Microsoft MVP - FrontPage ... "Thomas A. Rowe" wrote: ... if I go to the fp Server Extensions Console ...
    (microsoft.public.frontpage.extensions.windowsnt)