views:

517

answers:

3

Can you please let me know how to add flash object into the custom task pane using VSTO?

+1  A: 

You can add a "Shockwave flash object" control to your task pane or form region. You may have to find it in your user controls and add it in you tool box. You can then set the Movie property to the URI of the flash swf.

Marcus

Update

You can add you swf file to your project and set it to copy to output then you need to reference it in code.

add a helper property to you addin or copy the code out.

 static public string AssemblyDirectory { 
            get { 
                string codeBase = Assembly.GetExecutingAssembly().CodeBase; 
                UriBuilder uri = new UriBuilder(codeBase); 
                string path = Uri.UnescapeDataString(uri.Path); 
                return Path.GetDirectoryName(path); 
            } 
        }

Then in your taskpane showing/init event

String swfPath = AssemblyDirectory + Path.DirectorySeparatorChar + "menu.swf";
axShockwaveFlash1.LoadMovie(0, swfPath);
76mel
yes i did that but when i do setup the pulgin it will not have the flash object in it that is i tried to place the .swf (flash file) in project bin folder it didnt work but if i place flash file ouside the project folder and specify the path then it works fine even in that during setup .swf files are not copied
please help me how can i slove this
please can i know to which folder of my project i must add .swf file
hi Marcus thanks for the post i tried as u specified i placed .swf file in project folder i.e in bin directory then i copied that into output directory and i added ur code but it works when it is executed but it will not work when application is run through setup please can i know how to make it work
divya, How are you seting this up as click once ? also can you see the swf file in you vsto cache folder ? it could be a number of things .. one that it not getting copied or 2 security is stopping it .. also ouput the path ... Assembly.GetExecutingAssembly().CodeBase should get you the manifest .
76mel
You could also install the swf file in a known path on the client may be %app_data%
76mel
ya i am trying to setup through click once .swf file is available in setup folder Application files>bin>debug but also its not taking no security issue but one more thing i s after deployment the file extension is getting change like i.e before deployment movie.swf and after deployemnet movie.swf.DEPLOY like this its changing i am not able to proceedreally can be place flash object in custom pane???
How shall i copy .swf file in the process of setup ?? and how shall install swf file through setup??
Clickonce is a pain... when you click the vsto file its insatlls the addin into another location .. normally on XP c:\document and settings\<username>\Local Settings\Apps\2.0 and normally under one of the sub dires there. take a look to see if you swf flie is bein installed into there. You could always do a good old msi install .. check out : http://code.msdn.microsoft.com/VSTO3MSI/Release/ProjectReleases.aspx?ReleaseId=729
76mel
yes it getting copyied to the c:\document and settings\<username>\Local Settings\Apps\2.0 \flashexmp\bin\movie.swf to this location so can i give the path for this ,if yes then how can i give please help me
.swf is getting copied to the c:\document and settings\<username>\Local Settings\Apps\2.0\99876512.. \flashexmp..\bin\movie.swf to this location so can i give the path for this ,if yes then how can i give please help me
A: 

thanks for all who are all replied for my post the code helped me in one way i did some changes and i executed ,it solves my problem thanks for all the reply

Please post your answer as it will help others .. the above worked for me .. codebase contains the ClickOnce cache path and from there you can find your files.
76mel
the same code worked for me i just did the things in VB.NET and i just included .swf file into my project thats it
can you then mark it as answered so that other users can benifit
76mel
ok i will do that
A: 

Hi,

 I have come across such a situation where I need to put flash object in Outlook Addin while addin is loading for the first time. Can I load addin asynchronously ?

 Can you please provide help on that.

Thanks, Ashish Chotalia

Ashish