|
| |
|
|
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.
|
|
|
|
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??????
|
|
|
|
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
|
|
|
|
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 >
|
|
|
|
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?
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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.
_____________________________
|
|
|
|
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 >
|
|
|
|
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??????????
|
|
|
|
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" .
|
|
|
|
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
|
|
|
|
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?
_____________________________
|
|
|
|
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.
|
|
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
|
|
|