Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / November 2006

Tip: Looking for answers? Try searching our database.

FullName property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Calin - 28 Nov 2006 15:40 GMT
Hello

I builded a COM addin for PowerPoint which it is used to catch some events.
I have the following problem : during saving of an presentation (I have a
PresentationSave event handler) I'm opening a temporary, invisible
presentation and then close it immediatelly. Before opening the temporary
presentation, the FullName property returns a valid path (fully qualified)
for the current presentation. After I open/close the temporary presentation,
the FullName property returns something like "Presentation1". Somehow the
property value it is altered. Does anyone have any ideea how to deal with
this ? Is there any way to avoid this ?

Thanks, Calin
Austin Myers - 28 Nov 2006 17:11 GMT
Post the relevant code so we can see what's happening.

Austin Myers
MS PowerPoint MVP Team

Provider of PFCMedia, PFCPro, PFCExpress
http://www.pfcmedia.com

> Hello
>
[quoted text clipped - 10 lines]
>
> Thanks, Calin
Shyam Pillai - 29 Nov 2006 01:01 GMT
The only time you see this is when the presentation has never been saved
before. When this happens the Path property will be blank. Are you sure you
are closing the correct presentation?

Signature

Regards,
Shyam Pillai

Image Importer Wizard
http://skp.mvps.org/iiw.htm

> Hello
>
[quoted text clipped - 10 lines]
>
> Thanks, Calin
Calin - 29 Nov 2006 09:16 GMT
You're right. But, before I open the temporary presentation the FullName
property have a valid value. And yes, I'm sure, I close the correct
presentation, because I call close method on the presentation object
returned by Open method, so it should be ok.

Thanks, Calin

> The only time you see this is when the presentation has never been saved
> before. When this happens the Path property will be blank. Are you sure
[quoted text clipped - 14 lines]
>>
>> Thanks, Calin
Shyam Pillai - 29 Nov 2006 14:47 GMT
If you are certain that there is nothing wrong with your implementation then
you will need to resolve this yourself or else post your code here like
Austin suggested and we can take a look.

Signature

Regards,
Shyam Pillai

Animation Carbon
http://www.animationcarbon.com

> You're right. But, before I open the temporary presentation the FullName
> property have a valid value. And yes, I'm sure, I close the correct
[quoted text clipped - 21 lines]
>>>
>>> Thanks, Calin
Calin - 29 Nov 2006 16:03 GMT
Thanks.
Unfortunatelly the code is written in C++ and it is difficult to post the
entire project here. But here is the PresentationSave (dispid 2005) event
handler :

STDMETHODIMP CPPTSink::OnPresentationSave(IDispatch *pPresentation)
{
   OutputDebugString("OnPresentationSave\n");

   CComQIPtr<_Presentation> ptrPresentation(pPresentation);
   if(!ptrPresentation)
       return E_POINTER;

   // Get the FullName property value
   CComBSTR bstrFullName = ptrPresentation->FullName.copy(); // here I get
the right value

   _Application *pApplication = NULL;
   try
   {
       // get the _Application interface pointer from GIT
       HRESULT hr = m_pGIT->GetInterfaceFromGlobal(m_dwApplication,
__uuidof(_Application), (void**)&pApplication);
       if(FAILED(hr) || NULL == pApplication)
           return hr;

       // Open temporary, invisible, presentation
       CComPtr<_Presentation> ptrTempPresentation =
pApplication->Presentations->Open(_bstr_t(_T("c:\\test.ppt")), msoFalse,
msoFalse, msoTrue);
       if(ptrTempPresentation)
       {
           // Get the FullName property value
           bstrFullName = ptrPresentation->FullName.copy(); // here I still
get the right value

           // Close temporary presentation
           ptrTempPresentation->Close();
       }

       // Get the FullName property value
       bstrFullName = ptrPresentation->FullName.copy();  // here I get a
wrong value like "Presentation1"

       // Release _Application interface
       pApplication->Release();
       pApplication = NULL;
   }
   catch(_com_error &e)
   {
       OutputDebugString(e.ErrorMessage());
       HRESULT hr = e.Error();
   }
   catch(...)
   {
       OutputDebugString("C++ exception in CPPTSink::ConnectSink");
   }
}

best regards, Calin

> If you are certain that there is nothing wrong with your implementation
> then you will need to resolve this yourself or else post your code here
[quoted text clipped - 25 lines]
>>>>
>>>> Thanks, Calin
Shyam Pillai - 29 Nov 2006 17:01 GMT
I cannot reproduce the behavior in a VB port of your C++ code. I shall try
out the C++ code later today.

Signature

Regards,
Shyam Pillai

Animation Carbon
http://www.AnimationCarbon.com

> Thanks.
> Unfortunatelly the code is written in C++ and it is difficult to post the
[quoted text clipped - 87 lines]
>>>>>
>>>>> Thanks, Calin
Bill Dilworth - 30 Nov 2006 05:07 GMT
I don't speak C++, but it looks for all the world like you are trying to get
the full name off of the presentation you just closed.  I'd guess you need
to either reset your object to the current presentation or get the full name
before you close it.

Signature

Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@     Please read the PowerPoint FAQ pages.
yahoo.             They answer most of our questions.
com                 www.pptfaq.com
.

>I cannot reproduce the behavior in a VB port of your C++ code. I shall try
>out the C++ code later today.
[quoted text clipped - 90 lines]
>>>>>>
>>>>>> Thanks, Calin
Shyam Pillai - 30 Nov 2006 15:23 GMT
Not quite. ptrTempPresentation and ptrPresentation are two different
presentations. He is closing ptrTempPresentation and not ptrPresentation.

Signature

Regards,
Shyam Pillai

Animation Carbon
http://www.AnimationCarbon.com

>I don't speak C++, but it looks for all the world like you are trying to
>get the full name off of the presentation you just closed.  I'd guess you
[quoted text clipped - 95 lines]
>>>>>>>
>>>>>>> Thanks, Calin
Calin - 30 Nov 2006 21:47 GMT
You're right.

regards, Calin

> Not quite. ptrTempPresentation and ptrPresentation are two different
> presentations. He is closing ptrTempPresentation and not ptrPresentation.
[quoted text clipped - 98 lines]
>>>>>>>>
>>>>>>>> Thanks, Calin
Calin - 30 Nov 2006 21:47 GMT
No.
I call Close method on the interface pointer (object reference) returned by
Open method, which belongs to the temporary presentation.

regards, Calin

>I don't speak C++, but it looks for all the world like you are trying to
>get the full name off of the presentation you just closed.  I'd guess you
[quoted text clipped - 95 lines]
>>>>>>>
>>>>>>> Thanks, Calin
Calin - 30 Nov 2006 21:44 GMT
Thanks.

>I cannot reproduce the behavior in a VB port of your C++ code. I shall try
>out the C++ code later today.
[quoted text clipped - 90 lines]
>>>>>>
>>>>>> Thanks, Calin
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.