Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to start FrontPage in VFP

Status
Not open for further replies.

KoenPiller

Programmer
Apr 4, 2001
270
NL
Hi,

I would like to open a HTM page after I made a selection in in VFP Form. Basicly the same way one could open a Word page. Something like:

Code:
cMyPage= ThisForm.txtPage.Value 
loFrontPage=Createobject("Frontpage.Application")
loFrontPage=GetObject(,"Frontpage.application")
loFrontPage=loFrontPage.Activate(cMyPage)
loFrontPage.Activate
loFrontPage.Visible=.T.

however this does not work - error on line loFrontPage=loFrontPage.Activate(cMyPage) : OLEx0800200006 unknown name.

Somebody who could give me a clue how to solve this one?
Thanks,
Koen
 
Hi Geoff,

Thanks for the tip, but it does not work, now with
Code:
cMyPage= "E:\FrontPages\"+ThisForm.txtFaqnummer.Value 
loFrontPage=Createobject("Frontpage.Application")
loFrontPage=GetObject(,"Frontpage.application")
loFrontPage.url = cMyPage
loFrontPage.activate()
I get on line loFrontPage.url = cMyPage the same error about unknown name.

Koen
 
I'm only guessing but might it be because cMyPage is a file name rather than a URL?

No, that's not the case. The reason is that Frontpage does not have a URL property.

Koen,

Try this:

Code:
cMyPage= ThisForm.txtPage.Value 
loFrontPage=Createobject("Frontpage.Application")
loFrontPage=GetObject(,"Frontpage.application")
loFrontPage.Webs.Add(alltrim(cMyPage))

Also, loFrontPage does not have an Activate or a Visible. Try this instead:

Code:
lofrontpage.WebWindows(1).Visible = .t.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Hi,

1st of all, sorry, I believe in my original message posted in the general VFP Forum, but deleted by TekTip management, since I posted it in the wrong forum, I did indeed made it clear the variables are indeed files and no web-pages yet, so Geoff's assumption is right and, sorry Mike, your solution does not work.
What I need is to open htm files in FrontPage selecting these in a VFP Form. So open the the files in FrontPage in VFP just as it is done if you open them in Word, also in that case, FrontPage will open the file although you are working in Word. Hope I made it clear.
Thanks for finding a solution,
Koen
 
Mike,

Sorry,

The error code I get on line
Code:
 loFrontPage.Webs.Add(alltrim(cMyPage))
OLE IDespatch exception code 0 from ?:,, after I used your suggestion.
At least it is a different one than be4.

Koen
 
Geoff,

Which version is this? I'm sure I remember using the URL property and I've just found it in Help for FP2000

I'm also looking at FP2000. Actually, I can see the URL property in the Help as well, but I couldn't see it in Intellisense.

Koen,

OLE IDespatch exception code 0 from ?:,

Sorry, no idea. It works for me.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Mike,

Are you sure you have reproduced my exact situation?
I am trying to change and audit FrontPage Files, not yet published, with VFP.
I have 1000+ files, all .htm, the filenames are loaded into a cursor. The cursor populates a textbox, you could parse a GO button with a Click.property coding now under questioning. FrontPage should open and show me the htm file.
Remember: in case you change the whole thing to .doc files and replace the coding with oWord / "Word.Application" a.s.o. you would be able to audit and change the Word documents.
I believe your coding counts for published web pages.
Regards,
Koen
 
Keon,

Are you sure you have reproduced my exact situation?

No. I just did a quick bit of coding in the command window.

I believe your coding counts for published web pages.

Could be. I've never really understood the FrontPage terminology with regard to pages vs. webs vs. documents. It's just that, when I checked the properties through Intellisense, I couldn't see anything about documents or pages, but I could see a Webs collection.

I'm sorry if my replies have misled you.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top