import multiple folders

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I currently have a vba module in excel that creates all of my webpages for a
site. It creates the proper folder structure. My problem involves importing
these folders into web. I have to import each folder manually. This seems to
be a tedious process especially if i need to mass changes (much quicker for
me to recreate pages via vba module, than do it in frontpage.) I know I cant
ftp since the pages / forms rely on fp exts.

Is there an addon or another way to do this. I attempted to search for vba
samples for fp and could not locate too much. Any suggestions or assistance
would be greatly appreciated.

Thanks,
Jack
 
There is no reason you can't open FP (local PC preferably, online hosted site also possible) from the Excel VBA and thru your VBA
add the folders to the site using parts of the below code

Dim objFPApp As FrontPage.Application 'FP Application Object
Set objFPApp = FrontPage.Application 'Refers to FP App
Dim strWebUrl As String 'WebURL of site
Dim strUserID As Variant ' String 'UserId of WebURL
Dim strPword As Variant ' String 'Password of WebURL

Then either
Set objWebs = FrontPage.Application.Webs
objWebs.Open (strWebUrl) ' DBW No UID/PWD
Or
Set objWebs = FrontPage.Webs.Open(strWebUrl, strUserID, strPword, fpOpenInWindow)

--

_____________________________________________
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 currently have a vba module in excel that creates all of my webpages for a
| site. It creates the proper folder structure. My problem involves importing
| these folders into web. I have to import each folder manually. This seems to
| be a tedious process especially if i need to mass changes (much quicker for
| me to recreate pages via vba module, than do it in frontpage.) I know I cant
| ftp since the pages / forms rely on fp exts.
|
| Is there an addon or another way to do this. I attempted to search for vba
| samples for fp and could not locate too much. Any suggestions or assistance
| would be greatly appreciated.
|
| Thanks,
| Jack
 
Stefan,
Thank you for the info. I believe it has gotten me to the right path. I
searched the msdn site for various commands and have come up with something.
I believe I am on the right path but really could use some assitance.

As I mentioned I created a vba routine in excel that creates each webpage. I
believe I can include the following function after it closes / finishes
writing the htm file.

Public Function ExportToWeb(FilePath As String)
' This is what Filepath looks like
"C:\dumpfolder\statefoldername\secondaryfolder\htmfile.htm"
Dim objFPApp As FrontPage.Application
Dim objWebs As Object
Dim objFile As WebFile
Dim strLocalUrl As String
Dim strWebUrl As String
Dim strUserID As Variant
Dim strPword As Variant
strLocalUrl = "C:\Documents and Settings\blah\Desktop\igpo010606"
Set objFPApp = FrontPage.Application
Set objWebs = FrontPage.Webs.Open(strLocalUrl)
Set objFile = ActiveWeb.RootFolder.Files _
..Add(FileUrl = FilePath, [ForceOverwrite:=True])
objFile.Open
End Function

I have a couple questions. First I believe that I can pull the localweb path
from excel sheet so currently the localpath is hardcoded. Does function
assume that is the activeweb?

Second question - I have the full path coming into the exporttoweb function.
Will I need to separate this out so that FP will know where to place? For
example FilePath =
"C:\dumpfolder\statefoldername\secondaryfolder\htmfile.htm" full path to
newly created file. Will I need for it to be something like FilePath =
"statefoldername\secondaryfolder\htmfile.htm" since that is way web directory
is set up?

And last question: Will FP need to be open during the import process?

Again thanks for your help. Any suggestions would be greatly appreciated.
Jack

Stefan B Rusynko said:
There is no reason you can't open FP (local PC preferably, online hosted site also possible) from the Excel VBA and thru your VBA
add the folders to the site using parts of the below code

Dim objFPApp As FrontPage.Application 'FP Application Object
Set objFPApp = FrontPage.Application 'Refers to FP App
Dim strWebUrl As String 'WebURL of site
Dim strUserID As Variant ' String 'UserId of WebURL
Dim strPword As Variant ' String 'Password of WebURL

Then either
Set objWebs = FrontPage.Application.Webs
objWebs.Open (strWebUrl) ' DBW No UID/PWD
Or
Set objWebs = FrontPage.Webs.Open(strWebUrl, strUserID, strPword, fpOpenInWindow)

--

_____________________________________________
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 currently have a vba module in excel that creates all of my webpages for a
| site. It creates the proper folder structure. My problem involves importing
| these folders into web. I have to import each folder manually. This seems to
| be a tedious process especially if i need to mass changes (much quicker for
| me to recreate pages via vba module, than do it in frontpage.) I know I cant
| ftp since the pages / forms rely on fp exts.
|
| Is there an addon or another way to do this. I attempted to search for vba
| samples for fp and could not locate too much. Any suggestions or assistance
| would be greatly appreciated.
|
| Thanks,
| Jack
 
See inline below
--

_____________________________________________
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
_____________________________________________


| Stefan,
| Thank you for the info. I believe it has gotten me to the right path. I
| searched the msdn site for various commands and have come up with something.
| I believe I am on the right path but really could use some assitance.
|
| As I mentioned I created a vba routine in excel that creates each webpage. I
| believe I can include the following function after it closes / finishes
| writing the htm file.
|
| Public Function ExportToWeb(FilePath As String)
| ' This is what Filepath looks like
| "C:\dumpfolder\statefoldername\secondaryfolder\htmfile.htm"
| Dim objFPApp As FrontPage.Application
| Dim objWebs As Object
| Dim objFile As WebFile
| Dim strLocalUrl As String
| Dim strWebUrl As String
| Dim strUserID As Variant
| Dim strPword As Variant
| strLocalUrl = "C:\Documents and Settings\blah\Desktop\igpo010606"
| Set objFPApp = FrontPage.Application
| Set objWebs = FrontPage.Webs.Open(strLocalUrl)
| Set objFile = ActiveWeb.RootFolder.Files _
| .Add(FileUrl = FilePath, [ForceOverwrite:=True])
| objFile.Open
| End Function
|
| I have a couple questions. First I believe that I can pull the localweb path
| from excel sheet so currently the localpath is hardcoded. Does function
| assume that is the activeweb?

In Excel you can have the file (to import) location and FP web location (and any credentials) as cells w/ named ranges and call them
up in your VBA
For your import files use a full Path (for Excel to find it) as in
C:\dumpfolder\statefoldername\secondaryfolder\htmfile.htm
For webs use the same method for Disc based webs as in
C:\Documents and Settings\blah\Desktop\igpo010606 if your web name is igpo010606

PS
Why are you using a FP web folder on your Desktop?
- dangerous & bad practice
- move it (publish in FP) to say C:\igpo010606


|
| Second question - I have the full path coming into the exporttoweb function.
| Will I need to separate this out so that FP will know where to place? For
| example FilePath =
| "C:\dumpfolder\statefoldername\secondaryfolder\htmfile.htm" full path to
| newly created file. Will I need for it to be something like FilePath =
| "statefoldername\secondaryfolder\htmfile.htm" since that is way web directory
| is set up?

If your root web is named igpo010606 and you want it in the folder: statefoldername\secondaryfolder then do it all in Excel. Since
you are using a disc based web Don't use FP for Import/Add, just use Excel FSO code to copy the file from one disc location to
another on your PC. Then after you are done just use Excel to Open FP, recalc links and close FP (see below)

|
| And last question: Will FP need to be open during the import process?

Not if you use disc based files only (see above),
After you have copied the file to your disc based file location in Excel (see above)
- then open FP and just run a Tool Recalculate hyperlinks

Dim strLocalUrl As String
strLocalUrl = "C:\igpo010606"
Dim objFPApp As FrontPage.Application
Set objFPApp = FrontPage.Application
objFPApp.Webs.Open (strLocalUrl)
objFPApp.ActiveWeb.RecalcHyperlinks
Set objFPApp = Nothing
objFPApp.Quit


|
| Again thanks for your help. Any suggestions would be greatly appreciated.
| Jack
|
| "Stefan B Rusynko" wrote:
|
| > There is no reason you can't open FP (local PC preferably, online hosted site also possible) from the Excel VBA and thru your
VBA
| > add the folders to the site using parts of the below code
| >
| > Dim objFPApp As FrontPage.Application 'FP Application Object
| > Set objFPApp = FrontPage.Application 'Refers to FP App
| > Dim strWebUrl As String 'WebURL of site
| > Dim strUserID As Variant ' String 'UserId of WebURL
| > Dim strPword As Variant ' String 'Password of WebURL
| >
| > Then either
| > Set objWebs = FrontPage.Application.Webs
| > objWebs.Open (strWebUrl) ' DBW No UID/PWD
| > Or
| > Set objWebs = FrontPage.Webs.Open(strWebUrl, strUserID, strPword, fpOpenInWindow)
| >
| > --
| >
| > _____________________________________________
| > 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 currently have a vba module in excel that creates all of my webpages for a
| > | site. It creates the proper folder structure. My problem involves importing
| > | these folders into web. I have to import each folder manually. This seems to
| > | be a tedious process especially if i need to mass changes (much quicker for
| > | me to recreate pages via vba module, than do it in frontpage.) I know I cant
| > | ftp since the pages / forms rely on fp exts.
| > |
| > | Is there an addon or another way to do this. I attempted to search for vba
| > | samples for fp and could not locate too much. Any suggestions or assistance
| > | would be greatly appreciated.
| > |
| > | Thanks,
| > | Jack
| >
| >
| >
 
Back
Top