473,499 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically Generate PowerPoint in C++ .NET

27 New Member
Hi,

Is there a way to dynamically generate a powerpoint file from scratch in C++ .NET? I'm running VS2008 and from what I've found supposedly Visual Tools for Office is already installed. The problem is I can't access any namespaces (e.g. PowerPoint, Microsoft.Office.Core, etc). Any ideas? Or do I have to create a generic powerpoint file and then populate it programmatically? Thanks.
Mar 27 '09 #1
3 4545
pks00
280 Recognized Expert Contributor
there is vb.net code here http://www.codeproject.com/KB/vb/Pow..._in_VBNET.aspx which you could possibly adapt. Key thing here is the imports used. Given this you can do the equivalent in C++.net
Mar 28 '09 #2
vipergt023
27 New Member
Thanks. I'll give it a try.
Mar 30 '09 #3
vipergt023
27 New Member
I'm on the right track I think, but does anyone know how to set the text in a cell in a table on a powerpoint slide? This is what I'm doing...

PpApp = gcnew PowerPoint::Application();
PpApp->Visible = MsoTriState::msoTrue;
PowerPoint::Presentations ^PpPresSet = PpApp->Presentations;
String ^val = WorkingDirectory + "\\wiips.pot";
PowerPoint::Presentation ^PpPres = PpPresSet->Open(val,
soTriState::msoFalse, MsoTriState::msoTrue, MsoTriState::msoTrue);
PowerPoint::Slides^ PpSlides = PpPres->Slides;
PowerPoint::Slide ^PpSlideImg = PpSlides->Add(1, PowerPoint::PpSlideLayout::ppLayoutBlank);
PowerPoint::Slide ^PpSlideTbl = PpSlides->Add(2, PowerPoint::PpSlideLayout::ppLayoutBlank);

//get picture parameters
int width = 0;
int height = 0;
GetPptPicSize(filename, &width, &height);
PpSlideImg->Shapes->AddPicture(filename, MsoTriState::msoFalse,
MsoTriState::msoTrue,
(float)(MAX_WIDTH + 20 - width)/2, (float)(MAX_HEIGHT + 20 - height)/2,
(float)width, (float)height);

PowerPoint::Shape ^tbl =
PpSlideTbl->Shapes->AddTable(CsvDs->Tables[0]->Rows->Count+1,
CsvDs->Tables[0]->Columns->Count, 10, 10, MAX_WIDTH, MAX_HEIGHT);

tbl->Table->Cell(1,1)->Shape->TextFrame->TextRange->Text = "hello";

The problem is that for some reason C++ .NET in VS2008 doesn't have a member
Text in the TextRange property. All the documentation says it does. What
gives? Thanks.

Vinoj
Mar 31 '09 #4

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

Similar topics

5
2006
by: MarjaR | last post by:
For my application I need to develop an interface with an external organisation, based on XMLHTTP messaging. Depending on the specific purpose of the communication, this external organisation...
7
25311
by: Rathtap | last post by:
I want to write a C# application (lets call it Generator) that will receive an argument(patient account number) and dynamically generate a series of linked HTML files (claim information, payments,...
2
2781
by: Jeff Johnson | last post by:
Hi, Does anyone know how I would code a dynamically generated CheckBoxList within a PlaceHolder? I have a function that returns an array, I then want to loop throuth the array and create...
0
357
by: jijo kuruvila | last post by:
How we can Dynamically generate a MS Word document using ASP.Net??? -- Jijo kuruvila trivandrum,Kerala,India
0
1474
by: KBuser | last post by:
I'm building an internal site which will allow for extremely customizable queries to be run against our SQL Server (2000) DB. The page is done in ASP .net 2.0, with C# code behind. The initial...
9
1847
by: sashang | last post by:
Hi I'd like to use metaclasses to dynamically generate a class based on a parameter to the objects init function. For example: class MetaThing(type): def __init__(cls, name, bases, dict,...
1
3436
by: Scott Zabolotzky | last post by:
I'm sure somebody has to have done this already but I can't find any good references. If I have an XML file with an associated XSD what is the best way to dynamically generate a web form with...
4
17384
by: Mike Logan | last post by:
I would like to dynamically create a Visio diagram from .Net. I tried looking at the Visio SDK, but the samples are extremely convoluted for me to understand. Does someone have an example of...
2
6506
by: ssmith147 | last post by:
Hi, I'm somewhat familiar with access and vb programming (I can read someone else's code, for the most part), but I'm still very green when it comes to creating solutions for my own needs. I'm...
0
7134
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
7012
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
7180
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
7225
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...
0
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3105
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.