OutFront Forums
     Home    Register     Search      Help      Login    

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

 

Macro for Frontpage DRW (Spooky) Diet

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Macro for Frontpage DRW (Spooky) Diet
Page: [1] 2   next >   >>
 
William Lee

 

Posts: 1229
Joined: 1/25/2002
From: Singapore
Status: offline

 
Macro for Frontpage DRW (Spooky) Diet - 3/7/2002 15:15:21   
This macro is written by Stephen Travis, MVP for Frontpage.
__________________________________________

Sub spooky_Diet()
    Dim innerHTML As String, Webbot As String
    If Not FrontPage.ActiveDocument Is Nothing Then
        If FrontPage.ActivePageWindow.ViewMode = fpPageViewNormal Then
            innerHTML = ActiveDocument.body.innerHTML
        Do
        Webbot = Ellipse(innerHTML, "<!--webbot" , "-->" )
        If Webbot = ""  Then Exit Do

            If InStr(Webbot, "bot=""" ) <> 0 Then
                innerHTML = Replace(innerHTML, Webbot, "" )
            End If
        
        Loop
        ActiveDocument.body.innerHTML = innerHTML
        End If
    End If
End Sub
    
Function Ellipse(i, s, e)
    Dim f As Integer, t As Integer
    Ellipse = "" 
    f = InStr(1, i, s, 1)
    If f > 0 Then
        t = InStr(f + 1, i, e, 1)
        If t > 0 Then
            Ellipse = Mid(i, f, t - f) & e
        End If
    End If
End Function


Updated to remove all web bot information.
Prevents crashing when using against list boxes.

Note - all webbot information is removed, so if you have bots other than database in the page, they will also be removed.

The other alternative is to specify all of the possible options that you want to include or exclde with this code :

 
           If InStr(Webbot, "bot=""Database" ) <> 0 Then
                innerHTML = Replace(innerHTML, Webbot, "" )
            End If
           If InStr(Webbot, " bot=""SaveAsASP" ) <> 0 Then
                innerHTML = Replace(innerHTML, Webbot, "" )
            End If
etc...




< Message edited by Spooky -- 9/26/2003 12:29:55 AM >
Mike54

 

Posts: 4872
Joined: 3/26/2001
From: Way Up Over
Status: offline

 
RE: Macro for Spooky Diet - 3/7/2002 17:29:53   
Hi William,

I guess I'll step forward and show my ignorance, exactly what does it do?

ah reckon, tharfo'e ah's, ah reckon.


(in reply to William Lee)
William Lee

 

Posts: 1229
Joined: 1/25/2002
From: Singapore
Status: offline

 
RE: Macro for Spooky Diet - 3/8/2002 4:26:36   
Hi Mike
Yes its good to be cautious and you showed the way for the rest, you din't showed your ignorance

This macro stripped all the webbot code of the DRW as was done in the Spooky Diet.
First you have to create this macro in FP.
Tools>Macro>macros..
Give it a name, then click Create.
This brings up the Visual Basic Editor interface.( Not sure if this is available on non-Windows OS)
Then copy the codes for the subroutine and function.
click Save and go back to FP.

Go to a page that you have inserted a results region.
Go to Tools>Macro>Macros..
Select the macro and click Run.

This macro will spooky-diet whatever results region you have on that page. If you have a particular results region on that page that you don't want to diet down, then this macro will not work.



Before I posted it, I tested it out more than twice

William Lee

Edited by - William Lee on 03/08/2002 05:57:53

(in reply to William Lee)
Mike54

 

Posts: 4872
Joined: 3/26/2001
From: Way Up Over
Status: offline

 
RE: Macro for Spooky Diet - 3/8/2002 6:22:32   
Thanks for explaining William.

Sounds like a "cool tool" and it's been placed in the toolbox.

ah reckon, tharfo'e ah's, ah reckon.


(in reply to William Lee)
Spooky

 

Posts: 26630
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Macro for Spooky Diet - 3/8/2002 19:48:52   
Hmm, thought I replied.....my mind must be going.

Ill try it soon myself!
Thanks William!


< Message edited by Spooky -- 12/5/2004 14:37:25 >

(in reply to William Lee)
SerenityNet

 

Posts: 1384
Joined: 6/12/2001
From: Allen, TX, USA
Status: offline

 
RE: Macro for Spooky Diet - 3/14/2002 0:19:12   
Wow William, this is great! I've got a new smiley button on my FP toolbar already and linked to run this macro.

To new users to the Spooky Diet, just remember to back up your page before putting it on a diet.

Thanks again,

Andrew
webmaster@serenitynet.net - But the fruit of the Spirit is love, joy, peace, patience, kindness, goodness, faithfulness, gentleness, and self-control..." Gal. 5:22

(in reply to William Lee)
Mike54

 

Posts: 4872
Joined: 3/26/2001
From: Way Up Over
Status: offline

 
RE: Macro for Spooky Diet - 3/18/2002 7:51:03   
Informational only.

Played with this over the weekend and it seems to work great. Point of caution however, don't try it on any DIW results pages. It locks everything up.
Leave it to MS to get everything working together smoothly, why can't a DRW just be a DRW?

ah reckon, tharfo'e ah's, ah reckon.


(in reply to William Lee)
stu

 

Posts: 142
From: doylestown,pa
Status: offline

 
RE: Macro for Spooky Diet - 3/30/2002 19:36:34   
William Lee,
Thanks very much for the macro. Works great - saved me a bunch of time.


(in reply to William Lee)
Light

 

Posts: 200
Joined: 3/28/2002
From: Earth
Status: offline

 
RE: Macro for Spooky Diet - 4/27/2002 23:02:21   
Hi William,

Thank you, this is great, works very good,

<%Thgil%>

(in reply to William Lee)
jwpenuel

 

Posts: 24
From: Fort Myers FL USA
Status: offline

 
RE: Macro for Spooky Diet - 5/16/2002 15:37:36   
I like the concept of this macro, but can't seem to get it to run. I followed the steps outlined below to create the macro, and it appears on the list. When I open a document in front page and run the macro, nothing seems to happen. I have tried switching to html view, highlighting html, etc, with no success.
I am using Front Page 2002.

Any suggestions?

James Penuel<BR>jpenuel@digestivehealth.com

Edited by - jwpenuel on 05/16/2002 15:38:28

(in reply to William Lee)
sarge

 

Posts: 387
From: London England
Status: offline

 
RE: Macro for Spooky Diet - 6/1/2002 20:27:58   
Oh boy, this is going to sound a reeely stupid question, but here goes...

I've gone into the 'Tips from the Community' forum, and then into 'Macro for Spooky Diet'. I want to set up the macro so that I have a little macro smiling face in Frontpage which I click on to do the Spooky Diet on the the current page. (I've done lots of macros in Word, successfully).

So, from within Frontpage I go to 'Tools', then 'Macro', them 'Macros', I type in 'Spooky_Diet' as the macro name, and click 'create'.

Then I paste the whole of the code in the window. This seems to give me two chunks of code, the first called 'Spooky_Diet' and the second called 'Ellipse'.

OK, all good so far. From here I can click the 'Run' button, and the thing duly runs, successfully. The current page in Frontpage is transformed. All those grey bits of code disappear, the whole thing shrinks wonderfully, the big yellow blobs in Preview disappear, etc.

Now, I would like to save this wonderful macro, so that all I have to do within Frontpage is to click a little smiling face.. and .. presto.

But how do I save it? I've tried saving File>Save Microsoft_Frontpage, and I've tried saving by clicking the floppy icon, but to no avail.

...anybody?

Regards,
Sarge

 

(in reply to William Lee)
Eli

 

Posts: 2652
From: ... er ...
Status: offline

 
RE: Macro for Spooky Diet - 6/4/2002 12:11:20   
Sweet!!! Thanks VERY much!I've been meaning to put my site on THE DIET but have resisted due to time restrictions - this works like a charm!

"... treat me like a child.."

(in reply to William Lee)
Cookie

 

Posts: 295
Joined: 2/7/2002
From: UK
Status: offline

 
RE: Macro for Spooky Diet - 6/20/2002 5:53:34   
Message in reply to Sarge:
How to assign the Spooky Diet macro to a Smiley Button:

1)Right click over the toolbar
2)Choose customise
3)Select the toolbars tab
4)Click New and name it "Spooky Diet" Click OK
5)Ensure the little tick box is checked, and you should now see somewhere on the page a new toolbar called Spooky Diet.
6)Click on the commands tab, scroll all the way to the bottom and choose Macros
7)Drag the smiley face that you can now see over to the Spooky Toolbar you have created.
8)Right Click the icon on your new tool bar and choose Assign Macro
9)Choose the spooky diet macro and click OK.
10)Drag the toolbar to wherever you want!!

Hope this helps!

Cookie

(in reply to William Lee)
sarge

 

Posts: 387
From: London England
Status: offline

 
RE: Macro for Spooky Diet - 6/20/2002 11:42:35   
Thanks Cookie!

 

(in reply to William Lee)
rdouglass

 

Posts: 9242
From: Biddeford, ME USA
Status: offline

 
RE: Macro for Spooky Diet - 6/26/2002 13:01:56   
Nice!!.... works well and a timesaver for people that use the DWR a lot....2 thumbs up!!!

(in reply to William Lee)
hzarabet

 

Posts: 1598
From: New Milford CT USA
Status: offline

 
RE: Macro for Spooky Diet - 6/28/2002 20:43:01   
WOW

_____________________________

http://www.SigningsHotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada

(in reply to William Lee)
Bnugent

 

Posts: 256
From: Tampa Florida Tampa, FL USA
Status: offline

 
RE: Macro for Spooky Diet - 7/15/2002 17:40:25   
Truly amazing. The amount of time saved is awesome!!!!

(in reply to William Lee)
Spooky

 

Posts: 26630
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Macro for Spooky Diet - 3/15/2003 14:28:40   
Also, refer to this post for a possible fix if you experience crashing :-)

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to William Lee)
ACEDISH

 

Posts: 177
Joined: 9/30/2002
From: Manassas, Virginia
Status: offline

 
RE: Macro for Spooky Diet - 5/21/2003 21:13:31   
Cool Beans, This is great. Will be one of the most used tools in FP

_____________________________

" Anyone who can only think of one way to spell a word obviously lacks imagination"

(in reply to William Lee)
evansforsyth

 

Posts: 275
Joined: 12/11/2001
From: Grande Prairie, Alberta, Canada
Status: offline

 
RE: Macro for Spooky Diet - 6/15/2003 16:18:01   
When running the macro a " run time error 5 . . .Invalid procedure call or argument" error shows up. The debugger goes to the following line.

ActiveDocument.body.innerHTML = innerHTML

It' s a simple DRW. Anybody have an idea what is happening?

Thanks!

Evans

(in reply to William Lee)
Spooky

 

Posts: 26630
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Macro for Spooky Diet - 6/19/2003 16:55:15   
Hmmm - sorry no. FP2002?
If you renew the macro, pasting from notepad, does it change?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to William Lee)
evansforsyth

 

Posts: 275
Joined: 12/11/2001
From: Grande Prairie, Alberta, Canada
Status: offline

 
RE: Macro for Spooky Diet - 6/20/2003 2:28:41   
Yes, FP 2002. Sounds like you' ve heard this lament before!

quote:

If you renew the macro, pasting from notepad, does it change?


No it seems to be the same, and still does not work. The macro used to work, on the same computer. Maybe that was before upgrading to Windows XP and FP2002. Wonder if the problem is in that area.

Has anyone heard if FP 2003 is better at databases than 2002? That would be the only reason I' d get excited about upgrading.

Spooky--I' ve noticed in a post that you are not really keen on 2003--do you expect that Outfront, and you in particular, be supporting 2003?

Thanks

Evans

(in reply to William Lee)
Spooky

 

Posts: 26630
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Macro for Spooky Diet - 6/20/2003 4:42:28   
With 2003, I fear data connections will become more inaccessible than they are now.
I havent used it yet, but my understanding is, unless you have 2003 server and Windows SharePoint Services, you may be out of luck for easy database display.

I hope thats not the case, and the DRW in some form still exists.
Someone can confirm?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to William Lee)
evansforsyth

 

Posts: 275
Joined: 12/11/2001
From: Grande Prairie, Alberta, Canada
Status: offline

 
RE: Macro for Spooky Diet - 6/20/2003 12:21:34   
Well, this morning the macro decided to work!

Created a new page, removed all borders, removed the theme, pasted in the DRW, did not save the page, and ran the macro!

Beats me, thought I' d tried that earlier--many times. (Not complaining, you understand.)

Then, of course, changed the criteria to " &DisciplineOfArtID&" (double quotes, no single quotes) to get rid of the data type mismatch.

Hope this helps the next person! (It' ll be a good reminder to me too.)

< Message edited by evansforsyth -- 6/20/2003 12:22:13 PM >

(in reply to William Lee)
ACEDISH

 

Posts: 177
Joined: 9/30/2002
From: Manassas, Virginia
Status: offline

 
RE: Macro for Spooky Diet - 7/3/2003 11:55:02   
I have the same problem with the macro, it will work when i first generate the page but if i bring up an old page and try to run the macro I get errors.

I uses FP2002 and win 2000pro

_____________________________

" Anyone who can only think of one way to spell a word obviously lacks imagination"

(in reply to William Lee)
lyners

 

Posts: 93
Joined: 7/25/2003
Status: offline

 
RE: Macro for Spooky Diet - 7/25/2003 15:52:05   
What is the difference between DRW and DIW? What is DRW? I tried using this tool, but it locked my system, which makes me think i must be using DIW.

Any help out there?:)

(in reply to William Lee)
Spooky

 

Posts: 26630
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Macro for Spooky Diet - 7/25/2003 15:56:24   
The DIW is a group of pages created by frontpage for the editing / adding / deleting / displaying of database pages.
The DRW is (typically) a display of data reached from the " insert" menu

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to William Lee)
lyners

 

Posts: 93
Joined: 7/25/2003
Status: offline

 
RE: Macro for Spooky Diet - 7/25/2003 16:07:32   
OK,
I have 1 page which has 3 database result tables. 2 are drop downs and the 3rd is the result from the selection of the first 2. I wanted to clean-up the FP ASP code. I tried using the macro, but frontpage locks up everytime I use the macro. Any ideas as to what is going on?

Signed,
Frustrated with the macro.:)

(in reply to William Lee)
Spooky

 

Posts: 26630
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Macro for Spooky Diet - 7/25/2003 16:16:45   
2 options
1) add a drw 1 to a page, run the macro on each one, then add all of the slimmed down code to one page.
2) Manually modify the code as per my original article without the macro

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to William Lee)
evansforsyth

 

Posts: 275
Joined: 12/11/2001
From: Grande Prairie, Alberta, Canada
Status: offline

 
RE: Macro for Spooky Diet - 7/28/2003 1:18:31   
Seem to remember that the macro does not work for a drop-down database result!

------------------------------------

Yahoo! Since that time the macro has been updated--it now works in all kindsa situations!

Evans

< Message edited by evansforsyth -- 9/14/2003 1:56:33 AM >

(in reply to William Lee)
Page:   [1] 2   next >   >>

All Forums >> Web Development >> ASP, PHP, and Database >> Macro for Frontpage DRW (Spooky) Diet
Page: [1] 2   next >   >>
Jump to: 1





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