Re: How do you modify and save txt or xml file using FP VBA or via
- From: "Marko" <Marko@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 27 Jul 2005 10:50:04 -0700
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.
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>
.
- Follow-Ups:
- Re: How do you modify and save txt or xml file using FP VBA or via
- From: Thomas A. Rowe
- Re: How do you modify and save txt or xml file using FP VBA or via
- References:
- How do you modify and save txt or xml file using FP VBA or via Add
- From: Marko
- Re: How do you modify and save txt or xml file using FP VBA or via Add
- From: Stefan B Rusynko
- Re: How do you modify and save txt or xml file using FP VBA or via
- From: Marko
- Re: How do you modify and save txt or xml file using FP VBA or via
- From: Thomas A. Rowe
- Re: How do you modify and save txt or xml file using FP VBA or via
- From: Marko
- Re: How do you modify and save txt or xml file using FP VBA or via
- From: Thomas A. Rowe
- How do you modify and save txt or xml file using FP VBA or via Add
- Prev by Date: Re: active content
- Next by Date: Re: active content
- Previous by thread: Re: How do you modify and save txt or xml file using FP VBA or via
- Next by thread: Re: How do you modify and save txt or xml file using FP VBA or via
- Index(es):
Relevant Pages
|