VBA - FollowMasterBackground does not seem to work

J

JohnM

I am trying to programatically copy (import) slides from one presentation to
another. Using this sample from VBA 2003 help ...

oPres.Slides(i).Copy()
With CCRMPPTPres.Slides.Paste
.FollowMasterBackground = Office.MsoTriState.msoFalse
.ColorScheme = oPres.SlideMaster.ColorScheme
.DisplayMasterShapes = True
End With

The slides copy without the original Master. Same issue with

CCRMPPTPres.Slides.InsertFromFile(FileName, 1)

While in ppt however Insert->Slides From File (with Keep Source Formatting
checked) of course works as expected. How do I do this same operation
programmatically?

I cannot seem to find a way to get slides and Masters from source
presentation to target presentation.

Any thoughts are appreciated.

Regards, John
 
J

JohnM

Actual test code ...

FollowMasterBackground = Office.MsoTriState.msoTrue (!TRUE!)

oPres.Slides(i).Copy()
With CCRMPPTPres.Slides.Paste
.FollowMasterBackground = Office.MsoTriState.msoTrue
.ColorScheme = oPres.SlideMaster.ColorScheme
.DisplayMasterShapes = True
End With
 
M

Mike M.

Microsoft decided not to expose the "Keep Source Formatting" smart tag
option through automation starting with PPT2002. This caused/causes me
great pain over the last 3 years. Anything properties affected (you have to
figure out what those are) you have to copy individually through code. Have
fun!
 
J

JohnM

Mike - Thanks for the unfortunate news ... but how to work around?

It appears I need to get the Master Collection from PresSource to PresTarget.
But Master is a ReadOnly prop. I can import / copy & paste slides ... but
not Masters. There must be a way?
 
J

JohnM

Mike - Thanks for the unfortunate news. But what of a work around?

It appears to me I have to get the Masters collections from Source to Target
Presentation, but Master prop is ReadOnly. I can import and copy / paste
slides from one Presentation to another but I am unable to see my way clear
to get the Master (slide template / backgrounds) to follow the slides?

Any thoughts on how to "gut this out"?
 
J

JohnM

Sorry for the nearly duplicate posts ... Post claimed it failed - so I did it
again.
 

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