Want to know if such a macro is possible

  • Thread starter Thread starter Pat
  • Start date Start date
P

Pat

I know virtually nothing about VBA, but I'm looking to automate the process
of someone publishing an HTML page through FrontPage on our company's
intranet. I have a table in a .mdb file that has two fields: "id" (primary
key) and "publicationDate."

Here's the gist of what this macro would need to do:
1.) When activated, a popup dialog comes up asking for the publicationDate.
2.) The value entered in step 1 is now used to make a new entry in the
table
3.) The id number of the previous insertion is then retrieved (using
"select @@identity" or something similar)
4.) This id number is then used as the name of the directory where this
page will be published
5.) Save/publish the page so that all associated links/images will also be
written to the appropriate location (on a network drive)

I figure that most of these steps (1-4) will be trivial, but I'm unsure if
the last step is possible. I'd appreciate any pointers/suggestions.
 
Yes you can do it
I recommend you do it as VBA in Access since the FP object module is available from any office program (make sure you add the FP 6
Web Object Reference in the Access VBE References)
- also see FP VBA help for the Publish method

Below is the bare script you would need from Access

Dim objFPApp As FrontPage.Application
Dim objWebs As Object
Dim strLocalUrl As String
Dim strWebUrl As String
Dim strUserID As Variant ' you may need 2 if not the same
Dim strPword As Variant ' you may need 2 if not the same
' go to your db to get value for above 4 strings
Set objFPApp = FrontPage.Application
Set objWebs = FrontPage.Webs.Open(strLocalUrl, strUserID, strPword, fpOpenInWindow)
Set objWebWindowEx = FrontPage.Application.ActiveWebWindow
objWebWindowEx.ViewMode = fpWebViewPage ' Default
objFPApp.ActiveWeb.RecalcHyperlinks
Dim varWeb As WebEx
Dim varPublishParam As FpWebPublishFlags
varPublishParam = fpPublishAddToExistingWeb + fpPublishIncremental
Set varWeb = Application.ActiveWeb
varWeb.Publish strWebUrl, varPublishParam, strUserID, strPword
' then clean up and close all objects

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


|I know virtually nothing about VBA, but I'm looking to automate the process
| of someone publishing an HTML page through FrontPage on our company's
| intranet. I have a table in a .mdb file that has two fields: "id" (primary
| key) and "publicationDate."
|
| Here's the gist of what this macro would need to do:
| 1.) When activated, a popup dialog comes up asking for the publicationDate.
| 2.) The value entered in step 1 is now used to make a new entry in the
| table
| 3.) The id number of the previous insertion is then retrieved (using
| "select @@identity" or something similar)
| 4.) This id number is then used as the name of the directory where this
| page will be published
| 5.) Save/publish the page so that all associated links/images will also be
| written to the appropriate location (on a network drive)
|
| I figure that most of these steps (1-4) will be trivial, but I'm unsure if
| the last step is possible. I'd appreciate any pointers/suggestions.
|
|
 
Back
Top