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

Tech-Archive recommends: Fix windows errors by optimizing your registry



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
    ... If you save the file to the filesystem then there should be any problem with ... > Set oWebFile = ActiveWeb.LocateFile ... but ActiveDocument returns nothing for TXT files. ... >> See VBA help on FileSystemObject ...
    (microsoft.public.frontpage.addins)
  • Re: Form.Hide vs End
    ... It is included in VBA only for backwards ... 'terminate' functions get called in due sequence. ... known 'issue' with VBA and ActiveDocument -- exactly as you describe, ... It opens up a dialog box ...
    (microsoft.public.word.vba.general)
  • Re: Form.Hide vs End
    ... > Using End is TERRIBLE practice. ... It is included in VBA only for backwards ... > known 'issue' with VBA and ActiveDocument -- exactly as you describe, ... It opens up a dialog ...
    (microsoft.public.word.vba.general)
  • Re: Automatically name document
    ... With ActiveDocument ... See the article "How to send an email from Word using VBA" at: ... Please reply to the newsgroup unless you wish to avail yourself of my ... Ron ...
    (microsoft.public.word.newusers)
  • Re: The remote server machine does not exist or is unavailable on Mail Merge
    ... > I use this same code in VBA and I've never had this problem. ... but it probably has something to do with how object variables ... VB6 to use ActiveDocument, but you don't tell it where to find ActiveDocument, ...
    (microsoft.public.word.mailmerge.fields)