[AccessD] Open asp template from Access form

Mitsules, Mark S. (Newport News) Mark.Mitsules at ngc.com
Mon Jun 28 05:45:14 CDT 2004


I've never automated FrontPage either, so I set a reference to it and got
this from the help file.  Although I was just browsing, it looks like you
might need to look into the "PageWindowEx Object" as well.  I hope it helps.

Mark


Private Sub StartFrontPage()
    Dim myNewFP As Variant
    Set myNewFP = CreateObject("FrontPage.Application")
    myNewFP.Webs.Open ("C:\MyWebs\Adventure Works")
    myNewFP.Webs.Close "(C:\MyWebs\Adventure Works")
    Set myNewFP = Nothing
End Sub

The following example creates a reference to an instance of the StartWorking
object.
Sub NewPage()
'Creates a new page using the StartWorking object
   Dim objApp As FrontPage.Application
   Dim objStrtWrk As StartWorking
   Set objApp = FrontPage.Application
   'Create a reference to an instance of the StartWorking object
   Set objStrtWrk = objApp.NewPageorWeb
End Sub






-----Original Message-----
From: Kath Pelletti [mailto:KP at sdsonline.net] 
Sent: Thursday, June 24, 2004 7:54 PM
To: AccessD at databaseadvisors.com
Subject: [AccessD] Open asp template from Access form


Hi eveyone - I need to write some code to open a 'template' file in
Frontpage (ie. create a new .asp file based on a frontpage template which I
will create)

I dont have much experience opening other apps, but I use this code in
another app to open a s/sheet in Excel (see below). Can you tell me - is
this the fastest way to open a Frontpage file too? 
Is it CreateObject ("Frontpage.application")?

TIA

Kath

----------------------------------------------------------------------------
----

Private Function CreateSpreadsheet(rsRecordset As ADODB.Recordset) As Long
Dim strerrormsg As String
Dim ExcelRunning As Boolean
Dim xlApp As Object
Dim cell()
Dim lRows As Long
Dim lColumns As Long
Dim lColPtr As Long
Dim lRowPtr As Long
Dim strRange As String

On Error GoTo Err_Handler

'Create spreadsheet
ExcelRunning = IsExcelRunning()
If Not ExcelRunning Then
    Set xlApp = CreateObject("Excel.Application")
Else
    Set xlApp = GetObject(, "Excel.Application")
End If

'Set xlapp = CreateObject("excel.application")
xlApp.Workbooks.Add


'etc etc


----------------------------------------------------------------------------
----

 Function IsExcelRunning() As Boolean
Dim strerrormsg As String
On Error GoTo Err_Handler
    
    Dim xlApp As Excel.Application
    On Error Resume Next
    Set xlApp = GetObject(, "Excel.Application")
    IsExcelRunning = (Err.Number = 0)
    Set xlApp = Nothing
    Err.Clear
Normal_exit:
    DoCmd.SetWarnings True
    Exit Function

Err_Handler:
    MsgBox "Error: [" & Err.Number & "]  " & IIf(Len(strerrormsg) > 0,
strerrormsg, Err.Description), vbCritical, "Error Message"
    hcursor = CursorID
    RetVal = SetCursor(hcursor)
    Resume Normal_exit
End Function


----------------------------------------------------------------------------
----

Kath Pelletti
Software Design & Solutions Pty Ltd.
Ph: 9505-6714
Fax: 9505-6430
KP at SDSOnline.net
-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list