OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

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

Sponsors
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.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Help with Spooky Diet Macro

 
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 >> Help with Spooky Diet Macro
Page: [1]
 
BeTheBall

 

Posts: 6493
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
Help with Spooky Diet Macro - 3/13/2003 13:15:40   
I have a page with a DB results regions that is rather large. I am going to do some customizing so I need to put it on a diet. I really don' t want to do it manually, so I was going to use the macro I read about here:

http://www.frontpagewebmaster.com/tm.asp?m=54911&appid=&p=&mpage=1&key=spooky%2Cdiet%2Cmacro&language=single&tmode=&smode=&s=

Maybe I haven' t created the macro correctly because when I click run, it locks up FrontPage completely and I have to exit via the Task Manager. Can someone give me some step by step instructions for creating the macro?

Here is what I did.

1. I copied the macro code directly from the above mentioned post.
2. I pasted the code into Notepad
3. I went to FrontPage (2000 version) and clicked Tools-Macro-Macros
4. I typed the name for the macro and clicked " Create"
5. In the Visual Basic Editor, I pasted the entire code from NotePad
6. I clicked the save icon and closed the Editor
7. I then went to the page that has the DB results region and ran the macro, which is when FP froze.
Spooky

 

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

 
RE: Help with Spooky Diet Macro - 3/13/2003 15:57:30   
You only had One function listed ?

Sub spooky_Diet()
...code
End Function

Not :

Sub Yourname()
Sub spooky_Diet()
...code
End Function
End Function


FP2002 or 2000?


_____________________________

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

Sp:)ky


(in reply to BeTheBall)
BeTheBall

 

Posts: 6493
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Help with Spooky Diet Macro - 3/13/2003 18:40:22   
I am using FP 2000. I am not sure I understand your first question. Keep in mind this is the first time I have touched the VB editor. Here is exactly what I pasted into the VB Editor:

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=" " Database" ) <> 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


I am sure there is probably something I don' t understand??????

(in reply to BeTheBall)
Spooky

 

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

 
RE: Help with Spooky Diet Macro - 3/13/2003 20:25:18   
I can only suggest deleting the macro and trying again - looks ok?

_____________________________

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

Sp:)ky


(in reply to BeTheBall)
hhammash

 

Posts: 1064
Joined: 8/19/2002
Status: offline

 
RE: Help with Spooky Diet Macro - 3/14/2003 8:24:32   
Hi betheball,

If you are using this macro with a Database results that has DRW drop downs it will not work. It will work with normal DRW.

I mean if you made one of your DRW as DROP down it will lock and you have to close frontpage.

To use it:
In FrontPage

1- Tools
2- Macro
3- Visutal Basic Editor
4- On the left side click your module 1
5- Paste the code in your last post and click save
6- Click the X button
7- Go back to Frontpage and select Tools/Macro/Macros
8- Click on Spooky_Diet
9- Run

Regards
Hisham

(in reply to BeTheBall)
Cookie

 

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

 
RE: Help with Spooky Diet Macro - 3/14/2003 9:36:58   
Also - If you have more than one DRW on the page this will lock up!


Dave

< Message edited by cookie -- 3/14/2003 9:37 AM >

(in reply to BeTheBall)
BeTheBall

 

Posts: 6493
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Help with Spooky Diet Macro - 3/14/2003 10:05:14   
Still no luck. I am testing the macro on a page that has only one DRW, with no dropdowns. It is a simple DRW with a text box search. Can someone post a screen shot or text version of their working macro?

(in reply to BeTheBall)
Eli

 

Posts: 2659
From: ... er ...
Status: offline

 
RE: Help with Spooky Diet Macro - 3/14/2003 10:48:08   

quote:

ORIGINAL: Cookie

Also - If you have more than one DRW on the page this will lock up!


Dave


works ok for me with multiple DRW

only thing that I could never get to work was custom DRW - locks Frontpage. So make sure your customs are added after you run the macro

(in reply to Cookie)
hhammash

 

Posts: 1064
Joined: 8/19/2002
Status: offline

 
RE: Help with Spooky Diet Macro - 3/14/2003 11:49:23   
Hi betheball,

Did you save the DRW before running the macro?

Hisham

(in reply to BeTheBall)
Long Island Lune

 

Posts: 2340
Joined: 6/8/2002
From: New York
Status: offline

 
RE: Help with Spooky Diet Macro - 3/14/2003 13:05:49   
I have 18 DRW' s on one page.

_____________________________


(in reply to BeTheBall)
Eli

 

Posts: 2659
From: ... er ...
Status: offline

 
RE: Help with Spooky Diet Macro - 3/14/2003 13:29:41   
quote:

ORIGINAL: Long Island Lune

I have 18 DRW' s on one page.


zowie cavie!

< Message edited by Micah -- 3/14/2003 1:29 PM >

(in reply to Long Island Lune)
Long Island Lune

 

Posts: 2340
Joined: 6/8/2002
From: New York
Status: offline

 
RE: Help with Spooky Diet Macro - 3/14/2003 13:44:07   
You said it!!!

As a matter of fact, I made a post about this a long time ago.
This is how I got started in Spooky diets.

LLLuneeeee:)

_____________________________


(in reply to BeTheBall)
BeTheBall

 

Posts: 6493
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Help with Spooky Diet Macro - 3/14/2003 13:50:37   
Hisham, you seem to have asked the magic question. Yes, I was testing it on a saved page. So when I read your post I created a new page and ran the macro before saving. Worked perfectly. Why is that? I am glad I can get it to work, but can' t understand why it wouldn' t work on a page that is already saved??????????

(in reply to BeTheBall)
Spooky

 

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

 
RE: Help with Spooky Diet Macro - 3/14/2003 15:20:49   
Its odd - I can run the macro quite happily on a saved page, so I guess you were lucky :-)

_____________________________

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

Sp:)ky


(in reply to BeTheBall)
BeTheBall

 

Posts: 6493
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Help with Spooky Diet Macro - 3/14/2003 21:30:13   
OK, I think I' ve got it. The problem is NOT related to whether or not the page has been saved. My problem ocurred anytime the DRW included a search form. As long as there was no search form it ran fine, but if it had a search form it froze. When there is a search form this bot is added to the code:

<!--webbot bot=" SaveAsASP" CLIENTSIDE
SuggestedExt=" asp" PREVIEW=" " -->

If I manually delete the bot and then run the macro it works.

I decided to experiment a little and added the following code to the macro:

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

I added it after this:

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

Now the macro works perfectly and strips out all bots where bot=" database..." or bot=" SaveAsASP" .


(in reply to BeTheBall)
hhammash

 

Posts: 1064
Joined: 8/19/2002
Status: offline

 
RE: Help with Spooky Diet Macro - 3/15/2003 6:12:48   
Hi betheball,

quote:

ORIGINAL: Spooky

Its odd - I can run the macro quite happily on a saved page, so I guess you were lucky :-)


I am with Spooky on this ODD, I meant by question that you better save it before running the Macro.

It is good that it worked.

Hisham

(in reply to Spooky)
Long Island Lune

 

Posts: 2340
Joined: 6/8/2002
From: New York
Status: offline

 
RE: Help with Spooky Diet Macro - 3/15/2003 12:38:47   
What macros work if not saved?

_____________________________


(in reply to BeTheBall)
ScribeVision

 

Posts: 274
From: None
Status: offline

 
RE: Help with Spooky Diet Macro - 3/16/2003 0:01:18   
Hi,

I had a similar problem with the macro on pages that had several DRW' s.

After a lot of frustration with lockups, I finally resolved the problem by creating a blank copy of the page, copying the DRW' s to the blank page one at a time. After copying a DRW, I ran the macro and the copied in the next.

Worked fine that way.

Good luck.

(in reply to BeTheBall)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Help with Spooky Diet Macro
Page: [1]
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