Quantcast
Channel: Visual Studio Tools for Office (VSTO) forum
Viewing all 5157 articles
Browse latest View live

Converting the current MS Word document to xml and saving it in a target file

$
0
0

Hi All,

In my add -in I want to build a feature which converts the currently opened document to xml and saves this xml in a separate file.

But i want this conversion to happen with a specific DTD file.I 'am able to convert , but not according to the standards,also this conversion seems to be having errors.Any help is much much appreciated.This is what I tried so far:

                    

private void button_convert(object sender, RibbonControlEventArgs e)
        {

           Word._Document oDoc;
           oDoc = Globals.ThisAddIn.Application.ActiveDocument;
           //Creating the instance of Word Application
        object Target = @"c:\\abc\\Target.XML";
             object Unknown = Type.Missing;
           // Specifying the format in which you want the output file 
            object format = Word.WdSaveFormat.wdFormatXMLDocument;

            //Changing the format of the document
           oDoc.SaveAs(ref Target, ref format,
                    ref Unknown, ref Unknown, ref Unknown,
                    ref Unknown, ref Unknown, ref Unknown,
                    ref Unknown, ref Unknown, ref Unknown,
                    ref Unknown, ref Unknown, ref Unknown,
                    ref Unknown, ref Unknown);

        }



Problem with VSTOInstaller.Config

$
0
0

Hi!

I have a problem with a developed application due to the VSTOInstaller.Config file. I have found the origin of the problem; for this reason I wish to understand the differences between:

  • Microsoft.Office.BusinessApplications.RunTime.DeploymentAction.HttpFbaRequestCreator
  • Microsoft.Office.BusinessApplications.Fba.HttpFbaRequestCreator

I have not found some documentation about those lines contained in the VSTOInstaller.Config file.

I want also to know/understand If I delete/rename the configuration file, will be there problems with other Microsoft applications?

Thanks in advance for your help!

Cordially,

--- Miguel-Angel

Could not create an instance of startup object

$
0
0

I have a Excel document file created within Excel 2007. When I Deployed it to client,it got a mistake like this:

************** Exception Text **************
Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateStartupObjectException: Could not create an instance of startup object Excel4Sales.ThisWorkbook in assembly Excel4Sales, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null.
   at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.CreateEntryPoint(String entryPointTypeName)
   at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IExecuteCustomization2.LoadEntryPoints(IntPtr serviceProvider)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Microsoft.VisualStudio.Tools.Office.Runtime
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.21006.1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Office.Runtime/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Office.Runtime.dll
----------------------------------------
Microsoft.Office.Tools
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.21006.1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.dll
----------------------------------------
Microsoft.VisualStudio.Tools.Applications.Runtime
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.21006.1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
----------------------------------------
Microsoft.VisualStudio.Tools.Applications.ServerDocument
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.21006.1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.ServerDocument/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
Excel4Sales
    Assembly Version: 1.0.1.0
    Win32 Version: 1.0.1.0
    CodeBase: file:///D:/Profiles/ctvp47/Local%20Settings/Apps/2.0/ZHK6QKRT.BYV/0RNJLT11.N97/exce..vsto_a9e18684d895eb94_0001.0000_19723c20e3b0b7f7/Excel4Sales.DLL
----------------------------------------
Microsoft.Office.Tools.Excel.v4.0.Utilities
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.30319.1
    CodeBase: file:///D:/Profiles/ctvp47/Local%20Settings/Apps/2.0/ZHK6QKRT.BYV/0RNJLT11.N97/exce..vsto_a9e18684d895eb94_0001.0000_19723c20e3b0b7f7/Microsoft.Office.Tools.Excel.v4.0.Utilities.DLL
----------------------------------------


But the "Excel4Sales" is my own project name , not the external Dlls.

What should I do?

thanks for any help.

Problem ASP.NET - Word - Server 2012

$
0
0

Have a good day.

I have a project in ASP.NET. Web application is running on my Windows Server 2012 R2 (IIS).

I have assigned in References : Microsoft Office 15.0 Object Library and Microsoft Word 15.0 Object Library.

I am using code below for work in MS Word 2012:

Dim WordApp As New
Microsoft.Office.Interop.Word.Application()

Everithing is fine until i start application in Visual Studio 2013 (IIS localhost). If i place web on server, It shows me this error:

Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

Sometimes it shows this:

[HttpException (0x80004005): Request timed out.]

I know that on the internet is a lot of solutions.but non of them if working for me. I have instaled on server: Office 2013 and Visual Studio 2013 (If i start project right from server with Visual Studio everithing works fine). I found in DCOM Config only Word 2003-2007. Thats why i allow for whole My Computer on cardCOM Security group or user names: UISR a ISS_IUSRS.

If i start in application any function, it stop me on this line Dim WordApp As New Microsoft.Office.Interop.Word.Application(). In Task Manager i see on server processMicrosoft Word (33 bit). It stop on 3,6 MB and after 1 minute it gives me error massage.

I do not know what to try next. Please give me some advice.

Thanks.



Ribbon button getimage callback ok,but image is not displayed,why?

$
0
0

I have a button that has a GetImage callback. outlook may call GetImage function ,and ppdispImage has been set. But image has not displayed always.

This is my code.could anyone tell me where code is incorrect? (hr is s_ok) thanks


extern "C" HINSTANCE g_hInst;
STDMETHODIMP COLAd::OnGetImage(IDispatch* pControl, IPictureDisp** ppdispImage)

{

HRESULT hr;

HANDLE hIco;

PICTDESC d_PICTDESC;

hr                        = E_NOTIMPL;

hIco                      = NULL;

d_PICTDESC.cbSizeofstruct = sizeof(PICTDESC);

d_PICTDESC.picType        = PICTYPE_ICON;

hIco = LoadImage(g_hInst,MAKEINTRESOURCE(IDI_ICON1),IMAGE_ICON,12,12,LR_SHARED);

if(hIco != NULL)

{

  d_PICTDESC.icon.hicon = (HICON)hIco;

  hr = OleCreatePictureIndirect(&d_PICTDESC,IID_IPictureDisp,true,(void**)&ppdispImage);

}

return hr;

}

Display a character code of default bullets in c#

$
0
0

Hi All,

range.ListFormat.ListValue gives the value count of any formatted list , is there a way to get the character code of a bullet in ms word using c# .Searched a lot , not able to find any methods all default bullets are under one library Word.WdListType.wdListBullet

I need to distinguish if a line has a circle bullet or arrow bullet .How do I do this? 

Thanks in advance!

The VSTO excel add-in disabled functionality is not working. While restarting the Excel, addin is getting enabled

$
0
0

The load behavior value is 3.

I am able to disable the addin but while restarting excel, the add-in is getting enabled by default.is there any any settings to be changed in excel for VSTO addin.

How to retain the disabled mode until it is enabling.

If anybody has some solution, please share it to me

Regards

Remya


Cannot type New Line in Word BuildingBlock

$
0
0
Good day!
I have created a simple Word add-in in which I programatically add building blocks to a document and insert content from a database. But when I try to edit a building block from Word, it seems that the range is fixed. I cannot type in a new line at the end of the building block. Why is this so?

Thanks.

System.Exception: An error occurred during the Microsoft VSTO Tools 4.0 install (exit code was -2146762485).

$
0
0

I have been trying to install a piece of software on 2 Windows 7 PCS called Rightfax...during installing I get the error below;

       System.Exception: An error occurred during the Microsoft VSTO Tools 4.0 install (exit code was -2146762485).

It then gives me an error log of ;

2015-04-23 14:43:03Z: Error: Unexpected problem occurred in task worker
       System.Exception: An error occurred during the Microsoft VSTO Tools 4.0 install (exit code was -2146762485).
          at CommonInstall.Tasks.InstallTask.LaunchInstall(String friendlyName, String exe, String args, Int32[] exitCodesToIgnore)
          at CommonInstall.Tasks.InstallVSTO.OnRun(ITaskFeedback feedback)
          at TaskWizard.Task.Run(ITaskFeedback feedback, Boolean recurse)
          at TaskWizard.TaskWorker.RunTasks()
          at TaskWizard.TaskWorker.OnDoWork(DoWorkEventArgs e)
2015-04-23 14:43:03Z: Error: Problem in sequence or one of its pages
       System.Exception: An error occurred during the Microsoft VSTO Tools 4.0 install (exit code was -2146762485).
          at CommonInstall.Tasks.InstallTask.LaunchInstall(String friendlyName, String exe, String args, Int32[] exitCodesToIgnore)
          at CommonInstall.Tasks.InstallVSTO.OnRun(ITaskFeedback feedback)
          at TaskWizard.Task.Run(ITaskFeedback feedback, Boolean recurse)
          at TaskWizard.TaskWorker.RunTasks()
          at TaskWizard.TaskWorker.OnDoWork(DoWorkEventArgs e)
          at CommonInstall.PreparationWorker.OnDoWork(DoWorkEventArgs e)
          at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
2015-04-23 14:43:03Z: Error: Problem in sequence or one of its pages
       System.Exception: An error occurred during the Microsoft VSTO Tools 4.0 install (exit code was -2146762485).
          at CommonInstall.Tasks.InstallTask.LaunchInstall(String friendlyName, String exe, String args, Int32[] exitCodesToIgnore)
          at CommonInstall.Tasks.InstallVSTO.OnRun(ITaskFeedback feedback)
          at TaskWizard.Task.Run(ITaskFeedback feedback, Boolean recurse)
          at TaskWizard.TaskWorker.RunTasks()
          at TaskWizard.TaskWorker.OnDoWork(DoWorkEventArgs e)
          at CommonInstall.PreparationWorker.OnDoWork(DoWorkEventArgs e)
          at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
2015-04-23 14:43:03Z: Info: Page changed from 'WizardWorkerPage' to 'ResultPage' driven by result 'Next' and exception 'none'
2015-04-23 14:44:06Z: Info: Page changed from 'ResultPage' to 'none' driven by result 'Next' and exception 'none'
2015-04-23 14:44:06Z: Info: Work has not been completed; install state will not be saved.
2015-04-23 14:44:06Z: Info: Reboot status = NotRequired
2015-04-23 14:44:06Z: Info: Exitcode = 0
2015-04-23 14:44:06Z: Info: Logging ended.

I have installed this software succesfully on other machines previously.....

How to send button click message to ribbon from a custom task pane in Word 2010 application level addin?

$
0
0

Hello All

I have developed a spell checker for my native language, which works with a dialog box for showing suggestions. Now I want to achieve the same through a custom task pane as it gets aligned to a side providing free access to the document.

The problem I am facing is to send button click messages to the ribbon, through which I am invoking custom task pane and iterating through the words of the document.

Thanks in advance for early reply.

Regards


Dharam Veer Sharma

Unable to install any add-in signed with sha256RSA certificate

$
0
0

We have Word 2010 add-ins that we have been distributing with our software for some time without problems. However since we renewed our code signing certificate, we can't deploy any of our add-ins anymore. It always fails with the following exception:

 


System.Deployment.Application.InvalidDeploymentException: Exception reading manifest from file:///C:/Users/abcd/Documents/Visual%20Studio%202012/Projects/WordAddIn1/bin/Debug/WordAddIn1.vsto: the manifest may not be valid or the file could not be opened. ---> System.Deployment.Application.InvalidDeploymentException: Manifest XML signature is not valid. ---> System.Security.Cryptography.CryptographicException: SignatureDescription could not be created for the signature algorithm supplied.
   at System.Security.Cryptography.Xml.SignedXml.CheckSignedInfo(AsymmetricAlgorithm key)
   at System.Security.Cryptography.Xml.SignedXml.CheckSignatureReturningKey(AsymmetricAlgorithm& signingKey)
   at System.Deployment.Internal.CodeSigning.SignedCmiManifest.Verify(CmiManifestVerifyFlags verifyFlags)
   at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
   --- End of inner exception stack trace ---
   at System.Deployment.Application.Manifest.AssemblyManifest.ValidateSignature(Stream s)
   at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)
   --- End of inner exception stack trace ---
   at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.GetManifests(TimeSpan timeout)
   at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()

 

We've pinpointed the problem to the fact that the new certificate is with sha256RSA signature algorithm, while the old one was with sha1RSA. We use that new certificate to sign executable and MSIs as well without any problems. Putting the old cert back (still valid two weeks) works as well.

By reproducing the problem to its simple form, we found out simply creating a new Word 2010 add-in from Visual Studio and setting the signing to our new certificate is sufficient for the VSTO to be unusable on all computers,including on the development machine that just built it (however launching it via F5 in VS2012 works).

Creating a simple C# application and configuring ClickOnce deployment for it using the same certificate does not present any problem, it only occurs with VSTO deployment.

 

The setup on the development machine is the following:

  • Visual Studio 2012 (therefore .NET 4.5 installed)
  • Office 2010 SP2 (x86)
  • Visual Studio 2010 Tools for Office Runtime (version 10.0.40303)
  • A valid code signing certificate with sha256RSA signature algorithm

While the problem seems similar to http://social.msdn.microsoft.com/Forums/windows/en-US/eba424ae-f7b7-4530-bb68-db3b9972a31e/  , it is different in that we already have .NET 4.5 deployed everywhere, and it fails on the development machine as well.

In addition, after a much more detailed investigation, it seems that the VSTOInstallerapplication always perform the deployment using the .NET 3.5 runtime instead of .NET 4.0. Indeed, looking at the loaded DLL/assemblies in VSTOInstaller.exe when it is displaying the error, Process Explorer shows that it loaded the 2.0 runtime instead of the 4.0. Maybe that explains why it fails on sha256 signatures, no matter what.

Is there a known workaround to that problem? What can we do except get another sha1RSA certificate?



How to deploy program to different version of office using wix.

$
0
0

   Hi,


I'm using Wix to deploy program, the following code checks Office Shared 2010 PIA, Excel 2010 PIA,Excel 2010.

But I want the program can be installed in the computer using Office 2013 as well,

How can I do this?

Could you plesas help me.

<!-- Search for Office 2010 Shared PIA --><Condition Message="A required component for interacting with Office Shared 2010 is not available. Please run setup.exe."><![CDATA[Installed OR SHAREDPIA]]></Condition><Property Id="SHAREDPIA"><ComponentSearch Id="SharedPia" Guid="64E2917E-AA13-4CA4-BFFE-EA6EDA3AFCB4" /></Property><!-- Search for Office 2010 Excel PIA --><Condition Message="A required component for interacting with Excel 2010 PIA is not available. Please run setup.exe."><![CDATA[Installed OR EXCELPIA]]></Condition><Property Id="EXCELPIA"><ComponentSearch Id="ExcelPia" Guid="EA7564AC-C67D-4868-BE5C-26E4FC2223FF" /></Property><!--find Excel2010--><Property Id="C_EXCEL14INSTALLED"><RegistrySearch Id="SearchExcel14" Type="raw"
          Root="HKLM" Key="SOFTWARE\Microsoft\Office\14.0\Excel\InstallRoot" Name="Path" /></Property><Condition Message="You must have Microsoft Office Excel 2010 installed to use this product.">
      C_EXCEL14INSTALLED</Condition>



Best Regards.


Harvey Zhang




How to determine active ribbon tab?

$
0
0

My addin ribbon has a few controls which show live database values. To avoid frequent updates I need to determine if my addin ribbon tab (created via Ribbon XML) is active or not. Example: I subscribe to the SelectionChange event in Outlook Explorer and if my tab is active, actual data will be inquired from the DB. If my tab is not active, no DB inquiry should be performed.

How can I do this? I did not find any event I could subscribe to.

Any help is very much appreciated.

Thanks,
Markus

Custom Save Dialog and Logic in Outlook 2013 Add in

$
0
0

I'm creating an addin for outlook 2013. I've got it all setup and such but I'm not sure how to achieve my objective. My boss wants a button on a ribbon that is shown during compose, read, and similar methods and either opens a save dialog or just saves it automatically without the dialog. The catch is that I want to add custom actions for this special save button, where it will rename the file and save it in a specific folder. All based on the sender's domain and address, the date, whether there are attachments, and such. Either it will save the attachments as well or I could have a separate button to do the same with any attachments; archiving them and renaming them a specific way based on date, file type, sender, etc.

How can I implement this? I assume it's in the method showMessage_Click. Which leads me to another question, what is the showMessage_Click even from? It is what causes my messagebox to pop up when you click the button, but assuming I want a save dialog or something else rather than a messagebox, do I still use showMessage_Click or is there another XXX_Click method to use for when clicking the button that would be more appropriate for my goals.

Also is there a list somewhere showing all of these different event methods?

Thanks for any help and guidance you can offer.

Write to Excel multiple sheet using late binding

$
0
0

Hi, 

Experts, I have following Code To add a Data Table To Work sheet ,

how can i make it suitable to add data to multiple sheet per table i.e. if i pass rather then a table a data set with n number of tables i want n nos of works sheets 

private void WriteToExcel(ref System.Data.DataTable dtExcel)
        {

            if (dgvData.RowCount == 0)
            {
                MessageBox.Show("GridView is Empty.");
                return;
            }

            tlsStatus.Text = "Export To Excel Strats.... ";

            tlsStatus.ForeColor = System.Drawing.Color.DeepPink;

            prbExcelGen.Value = 0;
            prbExcelGen.Minimum = 0;
            prbExcelGen.Maximum = dgvData.RowCount;
            prbExcelGen.Step = 1;
            prbExcelGen.Refresh();
            object objApp_Late;
            object objBooks_Late;
            object objBook_Late;
            object objSheets_Late;
            object objSheet_Late;
            object objRange_Late;
            object[] Parameters;

            string[] headers = new string[dgvData .ColumnCount];
            string[] columns = new string[dgvData.ColumnCount];
            int i = 0;
            int c = 0;
            for (c = 0; c <= dgvData.ColumnCount - 1; c++)
            {
                headers[c] = dgvData.Rows[0].Cells[c].OwningColumn.Name.ToString();
                //Convert Cell Names To A,B,C...Z , 65+C=CHR(C)=>A WHEN C=0
                i = c + 65;
                columns[c] = Convert.ToString((char)i);
            }

            try
            {
                // Get the class type and instantiate Excel.
                Type objClassType;
                objClassType = Type.GetTypeFromProgID("Excel.Application");
                objApp_Late = Activator.CreateInstance(objClassType);
                //Get the workbooks collection.
                objBooks_Late = objApp_Late.GetType().InvokeMember("Workbooks",BindingFlags.GetProperty, null, objApp_Late, null);
                //Add a new workbook.
                objBook_Late = objBooks_Late.GetType().InvokeMember("Add",BindingFlags.InvokeMethod, null, objBooks_Late, null);
                //Get the worksheets collection.
                objSheets_Late = objBook_Late.GetType().InvokeMember("Worksheets",BindingFlags.GetProperty, null, objBook_Late, null);
                //Get the first worksheet.
                Parameters = new Object[1];
                Parameters[0] = 1; //san 27.4.15 @10.15am
                objSheet_Late = objSheets_Late.GetType().InvokeMember("Item",
                BindingFlags.GetProperty, null, objSheets_Late, Parameters);

                //san help taken from https://social.msdn.microsoft.com/Forums/windows/en-US/36340ada-e13b-41cb-a31d-fb76121aa0d2/c-exporting-text-file-to-excel-and-column-formatting-problem?forum=csharpgeneral

                //Get all cells on the sheet
                Object Range = objSheets_Late.GetType().InvokeMember("Cells", BindingFlags.GetProperty, null, objSheet_Late, null);
                Parameters = new Object[1];
                Parameters[0] = "@";// Set Thne Format To Text
                Range.GetType().InvokeMember("NumberFormat", BindingFlags.SetProperty, null, Range, Parameters);//..and format to text

                Object EntireColumn = Range.GetType().InvokeMember("EntireColumn", BindingFlags.GetProperty, null, Range, null);//get entire column property of Cells
                EntireColumn.GetType().InvokeMember("Autofit", BindingFlags.InvokeMethod, null, EntireColumn, null);//..in order to use Autofit on all contents
                Parameters = new Object[1];
                Parameters[0] = "1:1";
                //san

                //if (true)
                //{
                // Create the headers in the first row of the sheet

                for (c = 0; c <= dgvData.ColumnCount - 1; c++)
                {
                    //Get a range object that contains cell.
                    Parameters = new Object[2];
                    Parameters[0] = columns[c] + "1";
                    Parameters[1] = Missing.Value;
                    objRange_Late = objSheet_Late.GetType().InvokeMember("Range",
                    BindingFlags.GetProperty, null, objSheet_Late, Parameters);
                    //Write Headers in cell.
                    Parameters = new Object[1];
                    Parameters[0] = headers[c];
                    objRange_Late.GetType().InvokeMember("Value", BindingFlags.SetProperty,
                    null, objRange_Late, Parameters);
                }
                //}

                // Now add the data from the grid to the sheet starting in row 2

                for (i = 0; i < dgvData.RowCount - 1; i++)
                {
                    prbExcelGen.PerformStep();
                    prbExcelGen.Refresh();
                    for (c = 0; c <= dgvData.ColumnCount - 1; c++)
                    {


                        //Get a range object that contains cell.
                        Parameters = new Object[2];
                        Parameters[0] = columns[c] + Convert.ToString(i + 2);
                        Parameters[1] = Missing.Value;
                        objRange_Late = objSheet_Late.GetType().InvokeMember("Range",
                        BindingFlags.GetProperty, null, objSheet_Late, Parameters);
                        //Write Headers in cell.
                        Parameters = new Object[1];
                        Parameters[0] = dgvData.Rows[i].Cells[headers[c]].Value.ToString();
                        objRange_Late.GetType().InvokeMember("Value", BindingFlags.SetProperty,
                        null, objRange_Late, Parameters);
                        //if (i == 0)
                        //    BoldRow(i, c, (EXL._Worksheet)objSheet_Late);
                    }
                    tlsStatus.Text = "Exporting Records...." + i;
                }

                //Return control of Excel to the user.
                Parameters = new Object[1];
                Parameters[0] = true;
                tlsStatus.Text = "Exporting Completed.";
                objApp_Late.GetType().InvokeMember("Visible", BindingFlags.SetProperty,
                null, objApp_Late, Parameters);
                objApp_Late.GetType().InvokeMember("UserControl", BindingFlags.SetProperty,
                null, objApp_Late, Parameters);
                /*
                 * oWB.SaveAs(fileName, Excel.XlFileFormat.xlOpenXMLWorkbook,
                    missing, missing, missing, missing,
                    Excel.XlSaveAsAccessMode.xlNoChange,
                    missing, missing, missing, missing, missing);
                 */

                //oWB = (Microsoft.Office.Interop.Excel._Workbook)objBook_Late;
                //oWB.SaveAs("file", EXL.XlFileFormat.xlXMLSpreadsheet, Type.Missing, Type.Missing, Type.Missing, Type.Missing, EXL.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
                //oWB.Save();
            }
            catch (Exception theException)
            {
                String errorMessage;
                errorMessage = "Error: ";
                errorMessage = String.Concat(errorMessage, theException.Message);
                errorMessage = String.Concat(errorMessage, " Line: ");
                errorMessage = String.Concat(errorMessage, theException.Source);
                MessageBox.Show(errorMessage);
            }
            finally
            {

            }



        }


Word 2007 Global Class

$
0
0
Greetings,
 
Using VS 2008 -VSTO - Word 2007 Add-In wizard.

Is there a way to add your own global references to the system generated Globals internal class? For example, I'd like to keep track of the document opened during a session. if an event handler gets a reference to the document deep clones it and adds it to a hash structure, I'd like this "structure" to be stored under the Global internal class.

On a different note, I do appreciate the ammount of work that went into build this framework. It makes it simple to build add-ins. The problem I have is that a lot of the power has been hidden by the framework, while that is very good for novices, it takes away control for an old guy like me.  Would it be possible to build just a assembly that gets loaded into an office application address space and shares the document model with it? Once again, the wizard is good, but I'd like a little more room to wiggle.

Thanks,

PP

How to check whether the presentation contains some non-standard font?

$
0
0

When I open an existing presentation which is created and modified on another computer (e.g., Mac or Linux), some texts in non-standard true type fonts prevent me from saving the presentation.

Error

So my question is

1) Is it possible to catch and handle this error in code?

2) Or is there any way to check whether a presentation contains some non-standard font?

Thanks

Word com add-in now only working immediately after rebuild

$
0
0

I am working on a Word add-in (a specialized editor) using C# Visual Studio 2013 and Word 2010 on a server2012 machine. My add-in did work OK for quite some time but then I started to enhance it: It does in fact still 'work' - butonly when I launch it using 'run' from Visual Studio 2013 and only when I do so immediately after a rebuild. If launching it after a 'build' or when hoping to access it directly from Word there is no access to my editor - tab.

Trying to look for it I go to settings in Word > addins > com addins. There I can see the add-in but it is unchecked, and checking it does not help: '...is not a valid..'

I can see that many others have similar problems using older versions - but I did not find a solution. Some people want to mess around in the registry but I am not too confident doing that. What could I try?


Peter the Creative Timewater

Visual Studio Tools for Office 2007 install for Visual Studio 2013

$
0
0

Is there a "Visual Studio Tools for Office 2007" installation available for the "Visual Studio 2013 Community" version? If so, can someone direct me to where I can find it.

I was able to install the VSTO March, 2014 update but only includes Office 2010 and 2013.  I need to do development for Office 2007 and would like to do it in VS 2013.


Organizer name comes in the Recipients list in outlook form region

$
0
0

Hi,

I have created a custom form region for a meeting in outlook 2010 and VSTO with the message class IPM.Appointment.MyCompanyName. 1) When we either create a new meeting based on that form region or open the existing meeting created based on that form region from the calendar, the Organizer name is showing in the recipients list i.e., in the To field. 2) If I remove the Organizer name from the recipients list and save the appointment, it shows the message that the "The attendees of the meeting has been changed. Do you want to save and send update or Close without saving. How to remove the organizer name from the recipients list and save the appointment without asking for this dialog.

Regards,

Vijay

Viewing all 5157 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>