473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to get the ppt total slide number using c#

7
Hi~,i'm trying to get a ppt's total slide number,with the office com,but i don't know which method will help,
my code can open a ppt only~


Expand|Select|Wrap|Line Numbers
  1. Object Nothing = Missing.Value;
  2.            PPT.Application apcprint = new PPT.Application();
  3.            PPT.Presentations presprint = apcprint.Presentations;
  4.            //  apcprint.Presentations;
  5.            PPT.Presentation preprint = null;
  6.            preprint = presprint.Open(filename, Microsoft.Office.Core.MsoTriState.msoCTrue, 
  7.                Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoFalse);

thx in advanced!
Jun 19 '10 #1
5 6699
mblank
7
i hava solved the problem
Jun 19 '10 #2
Hi,

Do you know how to get the current active slide?
Jul 17 '10 #3
mblank
7
@Sanjay77
hi~
if you open the ppt/pptx in c# using Microsoft.Office.Interop.PowerPoint,i don't think there is a "current active slide",can you tell me more about your problems?
Jul 18 '10 #4
Hi mblank,

Thank you for the response.

Below is my scenario,

1. I have created an add-in for PPT. When the user opnes the PPT, he can use my add-in to insert the image that are present in BO server.

2. There can be any no. of slides in the PPT. So I just want to know the current active slide where the user wants to insert the image. i.e. slide which the user is opened when he has clicked on my custom add-in.

After going through the object model, I wrote the below code which could server my purpose.

PowerPoint.DocumentWindow docWins = presentation.Application.Windows[1];
PowerPoint.View view = docWins.View;
PowerPoint.Slide sd =(PowerPoint.Slide) view.Slide;
MessageBox.Show(sd.SlideNumber.ToString());
Jul 18 '10 #5
mblank
7
@Sanjay77
hi~
i'am so sorry for responding you so late.
your idea is so good,but i have no idea about how to solve it,because i am a newbie in office programming.
Jul 20 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Kishor | last post by:
Hi Friends Please help me to write a C program to find the 5th (fifth) root of a given number. Ex:(1) Input : 32 Output : 5th root of 32 is 2 Ex:(1) Input : 243 Output : 5th root of 243 is...
36
by: Wei Su | last post by:
Hi, I have a text file abc.txt and it looks like: 12 34 56 23 45 56 33 56 78 ... .. .. ... .. .. I want to get how many rows totally in the text file, how to do this? Thanks.
0
by: mzaiady | last post by:
I need to know how to get the monitor, motherboard and other hardware information and serial number using C, i can do it with WMI in windows but it giveme just what installed and defalut, i need...
0
by: Czechfish | last post by:
How do I change my script to automatically play, rather than clicking through individual slides? What is the action script to skip to a specific slide in the show via a button? (Right now I have...
3
by: bgreffet | last post by:
I was recently searching fruitlessly for a freinds' cell number using pay sites and every option I could think of with zero results when all of a sudden my phone rings and the caller i.d. shows her...
0
by: steinerh | last post by:
Hi, I am using FSO (VB6.0 proff) to retrieve the serial number of my hardisk. Comparing the number with what WIN XP returns and also what I retrieve using the dir command in DOS is really...
1
by: mumbaisalsa | last post by:
hi all, i want to run the slide show say ten slides and then close it , but in my code given below it opens the slide show and closes immediately ... .. please give me a solution to this...
5
by: eberry707 | last post by:
Hello: I have been trying to figure out how to automatically show a "sum total" of the number of records (from the underlying query) in report form. For example, if the design view of a query...
4
by: umer786 | last post by:
Asalam u AlaikuM! hello frndz, here iz a problem that i hv faced i.e: i m from Pakistan n i m reading the Visual Basic in my college! our teacher give us a assignment of visual basic i.e"...
0
by: Mark | last post by:
Hi Guys, I am using Crystal Reports to create reports. Everything works great, except one issue. My report has 3 pages, but it shows 1 / 1+. Is there any way to show the total pages like 1 / 3...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.