|
| |
|
|
William Lee
Posts: 1273 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: 4847 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.
|
|
|
|
Spooky
Posts: 26680 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 >
|
|
|
|
SerenityNet
Posts: 1387 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
|
|
|
|
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.
|
|
|
|
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%>
|
|
|
|
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
|
|
|
|
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
|
|
|
|
Eli
Posts: 2659 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.."
|
|
|
|
rdouglass
Posts: 9280 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!!!
|
|
|
|
hzarabet
Posts: 1549 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
|
|
|
|
Bnugent
Posts: 257 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!!!!
|
|
|
|
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"
|
|
|
|
evansforsyth
Posts: 277 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
|
|
|
|
evansforsyth
Posts: 277 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
|
|
|
|
evansforsyth
Posts: 277 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 >
|
|
|
|
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"
|
|
|
|
evansforsyth
Posts: 277 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 >
|
|
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
|
|
|