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



Now I understand and know what you meant, and I do know capabilities of FSO
within an ASP page. However I am not using a browser for what I need to do.
I am using FP Client environment, with custom Addin toolbars. I need to write
to a text file in currently open site, from within FP Client Application.
While this is very easy to do for htm and html files, FP does not seem to
support editing txt files, which is what I am trying to get to the bottom of.

I do not think I can execute asp code from this environment.

I am trying to figure out how to use FP Server Extensions to help me EDIT
and save TXT file (in windowless environment) to a currently open site, which
I expect should be just as simple as editing and saving htm or html files
(but it's not).


"Thomas A. Rowe" wrote:

> Yes, FSO is a Windows Server component, but requires access permission on server for a specific
> folder, however some web host will not let you use it or you have to request it.
>
> I don't work with VBA, just Classic ASP, but I would think that you should be able to open a text
> file in Notepad, which is the default method that FP uses for .txt files.
>
> --
> ==============================================
> 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:607A6799-E0A2-46A3-953E-B7E3FD7FFFF3@xxxxxxxxxxxxxxxx
> > 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: Send and recive files
    ... After my asp page have readed this file, I have to send a response file to the client. ... I have to read a Chunk of file with FSO and send this Chunk to a client? ... Normally the server provides HTML ...
    (microsoft.public.inetserver.asp.general)
  • Re: Saving an ASP form to a text file
    ... How does that negate the FSO? ... If you notice in my original post, the problem is that it's> not my server and I don't have a specific file path for the file, just want> it to reside in the domain folder. ... >> Microsoft ASP MVP ...
    (microsoft.public.inetserver.asp.general)
  • Re: Cannot run the FrontPage Server Extensions on this page
    ... security update, then there is usually no charge for the call. ... > store Names and Passwords in a text file located in the _private folder on the server. ... > The way I'm trying to do this using ASP and have the asp script read the text file located in the ... >> Thomas A. Rowe (Microsoft MVP - FrontPage) ...
    (microsoft.public.frontpage.programming)
  • 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: Saving an ASP form to a text file
    ... Or can FSO be modified to just save the file in the current domain folder? ... > Microsoft ASP MVP ... >> another server, and program some pages for them. ...
    (microsoft.public.inetserver.asp.general)