Home > Software engineering >  C use COM how to control the already open the PPT file playback, flip?
C use COM how to control the already open the PPT file playback, flip?

Time:09-23

Such as problem, need to open a PPT file, note: just open and did not play here, how to use COM control after open the PPT of the play and flip?

CodePudding user response:

If is to use the com open the PPT file can be operation, which I have achieved; The situation now is to manually open the PPT file first, and then control the PPT, flip and exit, etc., to solve

CodePudding user response:

Start recording macros in PowerPoint 2003, manual, complete the required function end record macros, press Alt + F11 key, check just record macro corresponding VBA code,

CodePudding user response:

@ 4 teacher requirement is office2013 now, zhao with c + +; I just looked at 2013, found no record macro this function

CodePudding user response:

reference u010380485 reply: 3/f
@ zhao teacher requirement is office2013 now, 4 with c + +; I just looked at 2013, failed to find a record macro this feature

I didn't also said an and above and still have a record macro this feature,
(Microsoft disgracefully will this feature harmonious!)
Just cover (zhen) on the computer I leave (cang) have PowerPoint 2003, involvement will help you to record and the corresponding VBA code and post:
 Sub Macro1 () 
'
'macro recorded by [email protected], date: 2016-01-27
'

With ActivePresentation. SlideShowSettings
The ShowType=ppShowTypeSpeaker
. LoopUntilStopped=msoFalse
. ShowWithNarration=msoFalse
. ShowWithAnimation=msoTrue
. RangeType=ppShowAll
. AdvanceMode=ppSlideShowUseSlideTimings
. PointerColor. RGB=RGB (Red:=255, Green:=0, Blue:=0)
. Run
End With
SlideShowWindows (Index:=1). The Next
SlideShowWindows (Index:=1). The Next
SlideShowWindows (Index:=1). The Next
SlideShowWindows (Index:=1). The View. The Exit
ActiveWindow. View. GotoSlide Index:=4
End Sub

CodePudding user response:

@ 4 teacher zhao the thing is, let me do a PPT before our company program around the image, the image play out, but then puts forward a new demand requires the animation, but the use of MFC SetParent is inserted into the PPT directly, but in combination of other programs are too many bugs, some bugs almost short time can't solve it; Hence in other schemes, we use the dsoframer to open the PPT, but can't control the broadcast and PPT pages, wants to control the PPT of com to play and transitions, access to a considerable amount of data is to use com first open control again, can't use com control first manually open again,,,,,,,, after their psychosexuality, finally to achieve control, but can't play in the ocx, determined to give up,,, looking for other solution,,,

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- line -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
2013 did not find the record macro tools, but still have tools to create macros, but can only create the application of this document macros


But still want to thank miss zhao's answer

CodePudding user response:

The original poster can share code using com open the PPT file?

CodePudding user response:

Fyi:
//Copyright (C) 1992-1998 Microsoft Corporation 
//All rights reserved.
//
//This source code is only intended as a supplement to the
//Microsoft Visual c + + Language Reference and related
//electronic documentation provided with Microsoft Visual c + +.
//See these sources for detailed information regarding the
//Microsoft Visual c + + product.

//NOTE: This example will only work with Excel8 Office97 in
//the Compile with cl/GX comexcel. CPP
//TO DO: Edit the # import paths
//# pragma message (" Make sure you go to view the Options. The Directories and add the paths to mso97. DLL and vbeext1. The olb. Mso97. DLL will usually be a c: \ \ \ "\ Program Files \ Microsoft Office " \ \ \ "" \ \ Office, and vbeext1. The olb will be in c: \ \ " \ Program Files \ \ \ \ "" Common Files " \ \ \ "Microsoft Shared \ \ " VBA ")
# import "C: \ \ Program Files \ \ Common Files \ \ Microsoft Shared \ \ Office11 \ \ the oledata.mso DLL" no_namespace rename (" DocumentProperties ", "DocumentPropertiesXL")
# import "C: \ \ Program Files \ \ Common Files \ \ Microsoft Shared \ \ VBA \ VBA6 \ \ VBE6EXT OLB" no_namespace
# import "C: \ \ Program Files \ \ Microsoft Office \ \ OFFICE11 \ \ excel exe" rename (" DialogBox ", "DialogBoxXL") rename (" RGB ", "RBGXL") rename (" DocumentProperties ", "DocumentPropertiesXL") no_dual_interfaces

# pragma warning (of which: 4192 4146)

#include
#include

Void dump_com_error (_com_error & amp; E)
{
_tprintf (_T (" Oops - hit an error! \ n "));
_tprintf (_T (" \ \ a tCode=% 08 lx \ n "), e.E rror ());
_tprintf (_T (" \ \ a tCode fancy=% s \ n "), e.E rrorMessage ());
_bstr_t bstrSource (e.S ource ());
_bstr_t bstrDescription (e.D escription ());
_tprintf (_T (" \ \ a tSource=% s \ n "), (LPCTSTR) bstrSource);
_tprintf (_T (" \ \ a tDescription=% s \ n "), (LPCTSTR) bstrDescription);
}

//If this is placed in the scope of the smart Pointers, they must be
//explicitly Release (d) before CoUninitialize () is called. If any reference
//count is non - zero, a protection fault will occur.
Struct StartOle
{
StartOle () {CoInitialize (NULL); }
~ StartOle () {CoUninitialize (); }
} _inst_StartOle;

Void main ()
{
Using the namespace Excel;

_ApplicationPtr pXL;

Try
{
PXL. CreateInstance (L "Excel. Application");

The pXL - & gt; The Visible=VARIANT_TRUE;

WorkbooksPtr pBooks=pXL - & gt; Workbooks.
_WorkbookPtr pBook=pBooks - & gt; Add ((long) xlWorksheet);
_WorksheetPtr pSheet=pXL - & gt; ActiveSheet.

RangePtr pRange.
PRange=pSheet - & gt; Range [A21 "];
PRange - & gt; Value2=75 l;
//pRange - & gt; NumberFormatLocal="@".

_CommandBarsPtr pCmdbars=pXL - & gt; CommandBars;
Int iCmdbars=pCmdbars - & gt; GetCount ();

Sleep (1000);
PRange=pSheet - & gt; Range (" he "),
PRange - & gt; Insert ((long) Excel: : xlDown);
PRange - & gt; Merge ();

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related