Visual Basic WEb Publishing with FrontPage

G

Guest

I am having some trouble using VB and VBA to automate the publishing of a web
with FrontPage.

It seems that the FpWebPublishFlags have no effect on the way FrontPage
publishes.

Which news group deals with issues using VB and VBA with FrontPage.
 
T

Tom Gahagan

you might have a better shot at the frontpage programming group but many
that answer there answer here!

Best to you.......
Tom Gahagan
 
G

Guest

I have followed the msdn example for the publish method
http://msdn.microsoft.com/library/d...bafpw11/html/fpmthPublish_HV05274838.asp?_r=1

I would like the Vb6 (or VBA) publish command to use the FpWebPublishFlags
as described in msdn.
see FpWebPublishFlag
http://msdn.microsoft.com/library/en-us/vbafpw11/html/fphowConstants_HV01049733.asp?frame=true&_r=1

When I set them as follows:

Dim myPublishParam As FpWebPublishFlags
myPublishParam = fpPublishAddToExistingWeb + fpPublishIncremental
objWebWindow.Application.ActiveWeb.Publish RemoteWebPath, myPublishParam

It will only copy from local to remote when the file status is changed on
local and unchanged on remote. If I add a new file on the local - it will be
copied to the remote. If I add a new file on the remote that is not on the
local it does not get deleted (if I set the fpPublishSynchronize flag - it
has no effect). When I execute the publish command, it does not err. It
acts like the FpWebPublishFlags has no effect.

If I use the manual Publish button in FrontPage - it works just fine.
 
D

Duncan Chesley

I would like the Vb6 (or VBA) publish command to use the FpWebPublishFlags
as described in msdn.
see FpWebPublishFlags

I have just done a little of this in VB6. I found that for the FP
related cammands and parameters that worked I could press F1 in the
VB6 Dev Env after highlighting something like Files.Add and get VB FP
help. Things behave as advertised.

On MSDN I found lots of other stuff like you describe that didn't
work. My assumption was that the MSDN stuff applies to VB.net, as the
Table of Contents on that page seems to indicate.

To accomplish what you want with the primitive tools in VB6, I would
use the Add method. If you look in VB FP help for Add Method Property
Tests Collection Example there is a Last Modified example.

But I don't know much.

Duncan
 
S

Stefan B Rusynko

Have you tried adding fpPublishSynchronize

--




|I have followed the msdn example for the publish method:
| http://msdn.microsoft.com/library/d...bafpw11/html/fpmthPublish_HV05274838.asp?_r=1
|
| I would like the Vb6 (or VBA) publish command to use the FpWebPublishFlags
| as described in msdn.
| see FpWebPublishFlags
| http://msdn.microsoft.com/library/en-us/vbafpw11/html/fphowConstants_HV01049733.asp?frame=true&_r=1
|
| When I set them as follows:
|
| Dim myPublishParam As FpWebPublishFlags
| myPublishParam = fpPublishAddToExistingWeb + fpPublishIncremental
| objWebWindow.Application.ActiveWeb.Publish RemoteWebPath, myPublishParam
|
| It will only copy from local to remote when the file status is changed on
| local and unchanged on remote. If I add a new file on the local - it will be
| copied to the remote. If I add a new file on the remote that is not on the
| local it does not get deleted (if I set the fpPublishSynchronize flag - it
| has no effect). When I execute the publish command, it does not err. It
| acts like the FpWebPublishFlags has no effect.
|
| If I use the manual Publish button in FrontPage - it works just fine.
|
| "Tom Gahagan" wrote:
|
| > you might have a better shot at the frontpage programming group but many
| > that answer there answer here!
| >
| > Best to you.......
| > Tom Gahagan
| >
| > | > >I am having some trouble using VB and VBA to automate the publishing of a
| > >web
| > > with FrontPage.
| > >
| > > It seems that the FpWebPublishFlags have no effect on the way FrontPage
| > > publishes.
| > >
| > > Which news group deals with issues using VB and VBA with FrontPage.
| >
| >
| >
 
G

Guest

Yes - Buried in my rather long second post - I did mention that
fpPublishSynchronize had no effect.

Any other ideas ...

I would hate to abandon the work I've done and I really need a way to
automate the publishing process. Ideally - I would like it to work the same
ways as clicking on the PUBLISH button manually.

Thanks in advance for any additional help.
 
D

Duncan Chesley

Yes - Buried in my rather long second post - I did mention that
fpPublishSynchronize had no effect.

Any other ideas ...

Are AddTo and Incremental mutually exclusive with Synchronize? They
would seem redundant.

The Microsoft FP 4.0 Libraries referenced in my own project do not
include the fpPublishSynchronize parameter, so I couldn't test it.

Duncan
 
D

Duncan Chesley

Any other ideas ...

Have you set Option Explicit in your module? If not, have you checked
the value of fpPublishSynchronize in the debugger?

Just another thought.

Duncan
 
G

Guest

-Option Explicit had no effect.

-When I check
myPublishParam = fpPublishAddToExistingWeb + fpPublishSynchronize +
fpPublishIncremental
myPublishParam = 259 indebugger or msgbox

-As to your previous post - I have tried all combinations of the flags w &
w/o fpPublishSynchronize - the only flag that seems to work is the
fpPublishAddToExistingWeb flag!

Thanks for you time!
 
D

Duncan Chesley

the only flag that seems to work is the
fpPublishAddToExistingWeb flag!

Option Explicit would have flagged fpPublishSynchronize if it doesn't
exist (like in my version 4.0 libraries).

259 sounds OK assuming that fpPublishSynchronize=256

In LapLink the act of synchronizing two folders never deletes any
files. It just makes sure all the files are the same versions in both
folders. You can also specify a one-way synchronize operation. This
makes sure that all the files on the Source are also on the Target.
Perhaps VB is acting like that.

Have you tried just using MyPublishParam=fpPublishNone (assuming None
means "No Parameters" and not "Don't publish anything")?

Duncan
 
G

Guest

Since the web already exists, I have to also include
fpPublishAddToExistingWeb. If I do not include this flag, I get an error
indicating that it can't create the web - it already exists.

myPublishParam = fpPublishAddToExistingWeb + fpPublishNone

Same results as before.
 
D

Duncan Chesley

myPublishParam = fpPublishAddToExistingWeb + fpPublishNone

Same results as before.

I finally got MSDN to show me the constants. My FireFox browser
wouldn't do it. Had to use IE.

I'm curious. If you set the Synchronize flag does VB copy the
unmatched remote file to the local?

As a last grasp at a straw, you might try setting
fpPublishNoDeleteUnmatched (w/out Synch I assume). Perhaps MS misnamed
the flag and got it backwards. Stranger things have happened.

If all this fails, I suppose you could write a VB loop that compares
files on the remote with files on the local and deletes any extra
remote files.

Or avoid creating files on the remote that aren't on the local.

Duncan



Duncan
 
G

Guest

Already tried that on day one.

I guess I will just have to give up and manually publish the web.

Thanks for all your time and effort!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top