I'm not able to get around a bug in FrontPage 2003. I'm hoping someone can
suggest a workaround.

Here's the relevant code:
===============
Dim nTbHeight As Integer, pwCur As FrontPage.PageWindow

With pwCur.Document.all.Item("tbMain")
nTbHeight = .offsetHeight
If nTbHeight <> .offsetHeight Then Stop
If nTbHeight < 1000 Then Stop
===============

When I run this code, it stops at the last line. I learn that the value of
.offsetHeight is 7309, but the value of nTbHeight is only 374. Even so, the
code doesn't stop at the first test. For some reason, FrontPage thinks that
374 = 7309, but it correctly determines that 374 < 1000.

I've tried:
nTbHeight = .offsetHeight + 0
nTbHeight = .offsetHeight * 1
nTbHeight = INT(.offsetHeight)
...but nothing I can do will force FrontPage to assign the correct value to
nTbHeight.

I'm using the code to create and save roughly 80 pages, starting with a
standard page that I'm using as a template. Roughly half of the saved pages
have this problem. Each time I run the code I seem to have the problem with
a different set of pages.

I'm running the code from Excel modules.

Help!

Charley

Re: VBA bug workaround? by MD

MD
Mon Jul 12 14:29:22 CDT 2004

Charley,

You said, "I'm running the code from Excel Modules" meaning that you're using automation to start and run FP?


--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible

"Charley Kyd" <Kyd@IncSight.com> wrote in message news:uzmnJg4ZEHA.2296@TK2MSFTNGP10.phx.gbl...
> I'm not able to get around a bug in FrontPage 2003. I'm hoping someone can
> suggest a workaround.
>
> Here's the relevant code:
> ===============
> Dim nTbHeight As Integer, pwCur As FrontPage.PageWindow
>
> With pwCur.Document.all.Item("tbMain")
> nTbHeight = .offsetHeight
> If nTbHeight <> .offsetHeight Then Stop
> If nTbHeight < 1000 Then Stop
> ===============
>
> When I run this code, it stops at the last line. I learn that the value of
> .offsetHeight is 7309, but the value of nTbHeight is only 374. Even so, the
> code doesn't stop at the first test. For some reason, FrontPage thinks that
> 374 = 7309, but it correctly determines that 374 < 1000.
>
> I've tried:
> nTbHeight = .offsetHeight + 0
> nTbHeight = .offsetHeight * 1
> nTbHeight = INT(.offsetHeight)
> ...but nothing I can do will force FrontPage to assign the correct value to
> nTbHeight.
>
> I'm using the code to create and save roughly 80 pages, starting with a
> standard page that I'm using as a template. Roughly half of the saved pages
> have this problem. Each time I run the code I seem to have the problem with
> a different set of pages.
>
> I'm running the code from Excel modules.
>
> Help!
>
> Charley
>
>
>



Re: VBA bug workaround? by Charley

Charley
Tue Jul 13 09:40:52 CDT 2004

Yes. Here are a few lines of code early in the setup process:

Set g_fpApp = New FrontPage.Application
Set g_wbCur = g_fpApp.Webs.Open(g_sRootFolder)
Set g_fldrRoot = ActiveWeb.RootFolder

By the way, when I step through two critical lines of code, the routine
works just fine. One of those lines is...
nTbHeight = .offsetHeight
...which I discussed in my first post.

I ran the code yesterday, stepping at the appropriate times. It turns out
that I the code generates 206 pages, with four mouse clicks per page. Can
you spell carpal tunnel syndrome?

Charley


"MD Websunlimited" <none@none.com> wrote in message
news:OZs1KaEaEHA.3112@TK2MSFTNGP09.phx.gbl...
> Charley,
>
> You said, "I'm running the code from Excel Modules" meaning that you're
using automation to start and run FP?
>
>
> --
> Mike -- FrontPage MVP '97-'02
> http://www.websunlimited.com
> FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible
>
> "Charley Kyd" <Kyd@IncSight.com> wrote in message
news:uzmnJg4ZEHA.2296@TK2MSFTNGP10.phx.gbl...
> > I'm not able to get around a bug in FrontPage 2003. I'm hoping someone
can
> > suggest a workaround.
> >
> > Here's the relevant code:
> > ===============
> > Dim nTbHeight As Integer, pwCur As FrontPage.PageWindow
> >
> > With pwCur.Document.all.Item("tbMain")
> > nTbHeight = .offsetHeight
> > If nTbHeight <> .offsetHeight Then Stop
> > If nTbHeight < 1000 Then Stop
> > ===============
> >
> > When I run this code, it stops at the last line. I learn that the value
of
> > .offsetHeight is 7309, but the value of nTbHeight is only 374. Even so,
the
> > code doesn't stop at the first test. For some reason, FrontPage thinks
that
> > 374 = 7309, but it correctly determines that 374 < 1000.
> >
> > I've tried:
> > nTbHeight = .offsetHeight + 0
> > nTbHeight = .offsetHeight * 1
> > nTbHeight = INT(.offsetHeight)
> > ...but nothing I can do will force FrontPage to assign the correct value
to
> > nTbHeight.
> >
> > I'm using the code to create and save roughly 80 pages, starting with a
> > standard page that I'm using as a template. Roughly half of the saved
pages
> > have this problem. Each time I run the code I seem to have the problem
with
> > a different set of pages.
> >
> > I'm running the code from Excel modules.
> >
> > Help!
> >
> > Charley
> >
> >
> >
>
>



Re: VBA bug workaround? by MD

MD
Tue Jul 13 11:00:13 CDT 2004

Are you modifying an object then reusing it?


--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible

"Charley Kyd" <Kyd@IncSight.com> wrote in message news:ePSKodOaEHA.3112@TK2MSFTNGP09.phx.gbl...
> Yes. Here are a few lines of code early in the setup process:
>
> Set g_fpApp = New FrontPage.Application
> Set g_wbCur = g_fpApp.Webs.Open(g_sRootFolder)
> Set g_fldrRoot = ActiveWeb.RootFolder
>
> By the way, when I step through two critical lines of code, the routine
> works just fine. One of those lines is...
> nTbHeight = .offsetHeight
> ...which I discussed in my first post.
>
> I ran the code yesterday, stepping at the appropriate times. It turns out
> that I the code generates 206 pages, with four mouse clicks per page. Can
> you spell carpal tunnel syndrome?
>
> Charley
>
>
> "MD Websunlimited" <none@none.com> wrote in message
> news:OZs1KaEaEHA.3112@TK2MSFTNGP09.phx.gbl...
> > Charley,
> >
> > You said, "I'm running the code from Excel Modules" meaning that you're
> using automation to start and run FP?
> >
> >
> > --
> > Mike -- FrontPage MVP '97-'02
> > http://www.websunlimited.com
> > FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible
> >
> > "Charley Kyd" <Kyd@IncSight.com> wrote in message
> news:uzmnJg4ZEHA.2296@TK2MSFTNGP10.phx.gbl...
> > > I'm not able to get around a bug in FrontPage 2003. I'm hoping someone
> can
> > > suggest a workaround.
> > >
> > > Here's the relevant code:
> > > ===============
> > > Dim nTbHeight As Integer, pwCur As FrontPage.PageWindow
> > >
> > > With pwCur.Document.all.Item("tbMain")
> > > nTbHeight = .offsetHeight
> > > If nTbHeight <> .offsetHeight Then Stop
> > > If nTbHeight < 1000 Then Stop
> > > ===============
> > >
> > > When I run this code, it stops at the last line. I learn that the value
> of
> > > .offsetHeight is 7309, but the value of nTbHeight is only 374. Even so,
> the
> > > code doesn't stop at the first test. For some reason, FrontPage thinks
> that
> > > 374 = 7309, but it correctly determines that 374 < 1000.
> > >
> > > I've tried:
> > > nTbHeight = .offsetHeight + 0
> > > nTbHeight = .offsetHeight * 1
> > > nTbHeight = INT(.offsetHeight)
> > > ...but nothing I can do will force FrontPage to assign the correct value
> to
> > > nTbHeight.
> > >
> > > I'm using the code to create and save roughly 80 pages, starting with a
> > > standard page that I'm using as a template. Roughly half of the saved
> pages
> > > have this problem. Each time I run the code I seem to have the problem
> with
> > > a different set of pages.
> > >
> > > I'm running the code from Excel modules.
> > >
> > > Help!
> > >
> > > Charley
> > >
> > >
> > >
> >
> >
>
>