=> Insert webbot "include" with Frontpage VBA

A

Alexander

I want an new to insert the following Tag with FP VBA to my page

<!--webbot bot="Include" U-Include="xyz.htm" TAG="BODY" -->

what ist the correspondant VBA Code to do this?


Thanks
Alexander

(Does there exist a document in the Internet with the correspondent VBA-Code
for any FP-Command?)
 
S

Steve Easton

What's wrong with the built in include feature??


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer
 
A

Alexander

MY QUESTION
YOUR ANSWER:
What's wrong with the built in include feature??

MY COMMENT
There is nothing wrong with it. I just want to automate a couple of comands.
Maybe I can access the function executing the corresponding menu entry with
its ID (?)
Do you have exact code for this? How can I supply the URL of the Page to
include, in an automated way?

Thanks
Alexander




----------------------
 
S

Steve Easton

About the only way I know to find the ID of the include command from the insert dropdown is to
install Visual Studio.net and then open Frontpg.exe in it and find the ID for the entry point in the
executable.
imho:
1. not worth the hassle
2. it would probably fail unless you're able to program the corresponding registry entry.

But then I prefer the simple route. ( even though I have VS.net and have looked at Frontpg.exe using
it )

;-)


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
S

Stefan B Rusynko

See
http://msdn.microsoft.com/library/d.../en-us/vbafpd10/html/fpmthsetbotattribute.asp




| MY QUESTION
| > > I want an new to insert the following Tag with FP VBA to my page
| > > <!--webbot bot="Include" U-Include="xyz.htm" TAG="BODY" -->
| > > what ist the correspondant VBA Code to do this?
|
| YOUR ANSWER:
| > What's wrong with the built in include feature??
|
| MY COMMENT
| There is nothing wrong with it. I just want to automate a couple of comands.
| Maybe I can access the function executing the corresponding menu entry with
| its ID (?)
| Do you have exact code for this? How can I supply the URL of the Page to
| include, in an automated way?
|
| Thanks
| Alexander
|
|
|
|
| ----------------------
| | > What's wrong with the built in include feature??
| >
| >
| > --
| > Steve Easton
| > Microsoft MVP FrontPage
| > 95isalive
| > This site is best viewed..................
| > ..............................with a computer
| > | > >
| > >
| > > I want an new to insert the following Tag with FP VBA to my page
| > >
| > > <!--webbot bot="Include" U-Include="xyz.htm" TAG="BODY" -->
| > >
| > > what ist the correspondant VBA Code to do this?
| > >
| > >
| > > Thanks
| > > Alexander
| > >
| > > (Does there exist a document in the Internet with the correspondent
| VBA-Code
| > > for any FP-Command?)
| > >
| > >
| >
| >
|
|
 
A

Alexander

Insert webbot "include" with Frontpage VBA
==============================

MY QUESTION WAS
I want an new to insert the following Tag with FP VBA to my page>
<!--webbot bot="Include" U-Include="xyz.htm" TAG="BODY" -->>
what ist the correspondant VBA Code to do this?


SOLUTION FOUND:
The solution was achieved with the CommandBars.Execute methode and the
Sendkeys funtion.
(see code below)

In don't like the Sendkeys Funktion in this circumstance.
If you have an alternative solution please tell.

(As I want to insert the Bot at the Curser position, the
"MyBody.insertAdjacentHtml" Methode is not precise enough.)


CODE:
'====================================================
Public Sub Fp_InsertIncludeWebbot(Url, Optional MyForm As Object)
'---------------------------------------

'Fp_InsertIncludeWebbot Url
'Fp_InsertIncludeWebbot Url, Me '(if Using in a Form)

'---------------------------------------
'Inserts a Fp Webbot like:
'<!--webbot bot="Include" U-Include="MASTER/RightNavbar01.htm" TAG="BODY"
'---------------------------------------
Dim Left, Top
Dim ControlType, ControlId
ControlType = 1
ControlId = 4212 'ID of "Include Page" Command
'----------------------------------------
'Hide MyForm if necessary

If IsMissing(MyForm) Then
Else
Left = MyForm.Left
Top = MyForm.Top
MyForm.Hide '<<<<<<<< Focus is passed to Frontpage-Window
End If
'----------------------------------------
'Insert Include Webbot

SendKeys Url, False
SendKeys "{ENTER}", False
Vba_ExecuteCommandbarControl ControlType, ControlId
'Vba_ExecuteCommandbarControl ControlType, ControlId
DoEvents
'----------------------------------------
'Show MyForm if necessary

If IsMissing(MyForm) Then
Else
MyForm.Show '<<<<<<<< Focus is returned to MyForm
MyForm.Top = Top
MyForm.Left = Left
End If
'----------------------------------------
End Sub
'===================================================
Public Sub Vba_ExecuteCommandbarControl(ControlType, ControlId)
'--------------------------------------------

'Vba_ExecuteCommandbarControl ControlType, ControlId

'--------------------------------------------
'INFO:
'MsgBox Application.CommandBars("Test").Controls(1).Type
'MsgBox Application.CommandBars("Test").Controls(1).Id
'--------------------------------------------
On Error Resume Next
Err = 0
CommandBars(CommandBars.FindControl(ControlType,
ControlId).Parent.Index).FindControl(ControlType, ControlId).Execute
If Err <> 0 Then MsgBox "Error"
'--------------------------------------------
End Sub
'==================================================
 
M

MD Websunlimited

Alexander,

First a lot of time would be saved if you'd go to MSDN and review the material on the OM of FrontPage and the sample applications
found there.

To insert at the insertion point in FP use the IHTMLTxtRange object.

Dim oSelection As IHTMLTxtRange
' get the IP
Set oSelection = ActiveDocument.selection.createRange
oSelection.pasteHTML "<!--webbot bot=""Include"" U-Include=""" & sURL & """ TAG=""BODY"" "


--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
Wish you could calculate form field totals? Well, you can with Form Caculator
http://www.websunlimited.com/order/Product/FormCalc/formcalc.htm
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
 
A

Alexander

YOUR ANSWER:
Dim oSelection As IHTMLTxtRange
' get the IP
Set oSelection = ActiveDocument.selection.createRange
oSelection.pasteHTML "<!--webbot bot=""Include"" U-Include=""" & sURL & """
TAG=""BODY"" "

MY COMMENT
Unfortunately this does not work, at least in Fp2000.
It Results in:
<p><em>[http://www.abc.com/xyz.htm]</em></p>

This is why I used the Sendkeys method

Alexander



MD Websunlimited said:
Alexander,

First a lot of time would be saved if you'd go to MSDN and review the
material on the OM of FrontPage and the sample applications
 
M

MD Websunlimited

It does work in FP2000 something else is wrong.

--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
Stop Spam Email Mining from your web pages with SpamStopper
http://www.websunlimited.com/order/product/SpamStopper/spam_stopper_help_dir.htm
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible



Alexander said:
YOUR ANSWER:
Dim oSelection As IHTMLTxtRange
' get the IP
Set oSelection = ActiveDocument.selection.createRange
oSelection.pasteHTML "<!--webbot bot=""Include"" U-Include=""" & sURL & """
TAG=""BODY"" "

MY COMMENT
Unfortunately this does not work, at least in Fp2000.
It Results in:
<p><em>[http://www.abc.com/xyz.htm]</em></p>

This is why I used the Sendkeys method

Alexander



MD Websunlimited said:
Alexander,

First a lot of time would be saved if you'd go to MSDN and review the
material on the OM of FrontPage and the sample applications
found there.

To insert at the insertion point in FP use the IHTMLTxtRange object.

Dim oSelection As IHTMLTxtRange
' get the IP
Set oSelection = ActiveDocument.selection.createRange
oSelection.pasteHTML "<!--webbot bot=""Include"" U-Include=""" & sURL & """ TAG=""BODY"" "


--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
Wish you could calculate form field totals? Well, you can with Form Caculator
http://www.websunlimited.com/order/Product/FormCalc/formcalc.htm
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top