M
Michael Yorke
Hi,
I've been playing with macros and want to create a simple macro to insert 1
slide from a file stored on our network. I'm using InsertFromFile to get the
file into my powerpoint presentation but what annoys me is having to specify
the index (where in my presentation I want the slide inserted). I'm used to
clicking and having the cursor in the place where I want my slides inserted.
Below is the text from the PowerPoint VB help regarding InsertFromFile
Inserts slides from a file into a presentation, at the specified location.
Returns an integer that represents the number of slides inserted.
expression.InsertFromFile(FileName, Index, SlideStart, SlideEnd)
expression Required. An expression that returns a Slides collection.
FileName Required String. The name of the file that contains the slides
you want to insert.
Index Required Long. The index number of the Slide object in the
specified Slides collection you want to insert the new slides after.
SlideStart Optional Long. The index number of the first Slide object in
the Slides collection in the file denoted by FileName.
SlideEnd Optional Long. The index number of the last Slide object in the
Slides collection in the file denoted by FileName.
Example
This example inserts slides three through six from C:\Ppt\Sales.ppt after
slide two in the active presentation.
ActivePresentation.Slides.InsertFromFile _
"c:\ppt\sales.ppt", 2, 3, 6
I don't want to specify and index. or use the current position of the
cursor. Is this possible please? even if it means writing more code to
capture the current position?
thanks very much
I've been playing with macros and want to create a simple macro to insert 1
slide from a file stored on our network. I'm using InsertFromFile to get the
file into my powerpoint presentation but what annoys me is having to specify
the index (where in my presentation I want the slide inserted). I'm used to
clicking and having the cursor in the place where I want my slides inserted.
Below is the text from the PowerPoint VB help regarding InsertFromFile
Inserts slides from a file into a presentation, at the specified location.
Returns an integer that represents the number of slides inserted.
expression.InsertFromFile(FileName, Index, SlideStart, SlideEnd)
expression Required. An expression that returns a Slides collection.
FileName Required String. The name of the file that contains the slides
you want to insert.
Index Required Long. The index number of the Slide object in the
specified Slides collection you want to insert the new slides after.
SlideStart Optional Long. The index number of the first Slide object in
the Slides collection in the file denoted by FileName.
SlideEnd Optional Long. The index number of the last Slide object in the
Slides collection in the file denoted by FileName.
Example
This example inserts slides three through six from C:\Ppt\Sales.ppt after
slide two in the active presentation.
ActivePresentation.Slides.InsertFromFile _
"c:\ppt\sales.ppt", 2, 3, 6
I don't want to specify and index. or use the current position of the
cursor. Is this possible please? even if it means writing more code to
capture the current position?
thanks very much