Popular Searches: FrontPage Hosting | FrontPage Templates | FrontPage Training | Free FrontPage

Convert TXT with Macro   Logged in as: Guest
  Printable Version
All Forums >>FrontPage Specific Issues >>FrontPage Newbies >> Page: [1]
Name:
Message<< Newer Topic  Older Topic >>

schwarznavy

 

Posts: 1
Member since: 6/27/2008
 

Convert TXT with Macro 

Hello,

I don't know how to program macros, but I was wondering if someone could help point me in the right direction.

Basically, I'd like to be able to open up a .txt file that is structured a certain way. Then I'd use the macro within FrontPage to do the following:

- Add header html code
- take first line of text until the first carriage return and wrap it in certain tags
- take next line of text until next carriage return and wrap it in certain tags
- take next line of text until next carriage return and wrap it in certain tags
- take remaining lines of text and wrap it in certain tags
- Add footer html code

This will help me create news pages for my site. We have new stories coming in all the time, and I have 100's of old news stories that I have to convert to our new format.

Our first line will be the headline which is styled a certain way.
The second line is the "Story by" line.
The third line is the date posted.
The remaining text is the story itself.

Thank you very much.


< Message edited by schwarznavy -- 6/27/2008 8:51:32 PM >
  Report Abuse |  Date: 6/27/2008 8:49:45 PM

TexasWebDevelopers

Posts: 7013
Member since: 9/24/2002
From: USA

RE: Convert TXT with Macro (in reply to schwarznavy

I cannot help you with the MACRO--I played around a bit trying to use carriage returns as key elements to add opening/closing tags but I can't get it to work.
Sometimes manually touching the code is the only way to go. But I have a suggestion, since you may have to touch everything anyway, why not move the title, author, date, content, etc. to a database? In this way you can add/update/amend/delete content with a simple form and display the content dynamically. One page rather than hundreds. You can even dynamically present the META tags for the specific content. This is simple to do and really the way content like this should be organized and presented.


_____________________________



FrontPageTools.com:Templates, Tools and Training support this forum
  Report Abuse |  Date: 6/29/2008 7:29:49 AM

Rick_E

 

Posts: 3756
Member since: 2/14/2004
 

RE: Convert TXT with Macro (in reply to schwarznavy

If you know any programmer friends, this would be easy to do with some Visual Basic programming.


_____________________________

All the best, Rick E

FrontPage is being discontinued.
If you want to stay with FrontPage, upgrade to FrontPage 2003 now.

Search Microsoft KB for error msgs
http://support.microsoft.com/search/default.aspx?catalog=LCID%3D1033&spid=919&adv=1
  Report Abuse |  Date: 6/30/2008 12:43:19 PM
Page:   [1]
All Forums >>FrontPage Specific Issues >>FrontPage Newbies >> Page: [1]
Jump to:

New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



Forum Software powered by ASP Playground Advanced Edition 2.0.5
Copyright © 2000 - 2003 ASPPlayground.NET

0.046875