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

What to do and how to write "add-ins" for Offive Excel and Word (including ribbons) using VS-Community 2013

$
0
0

First, I hope that I have selected the appropriate location for this message. If not I apologize. I am hoping that posting to the VSTO  community will also cover the Word and Excel development groups.

Second, a word of explanation: I am partially handicapped (unable to use my left hand easily), and 73 years of age and retired, and due to medical prescriptions unable to respond as quickly as I might desire. Consequently I may be tardy in responding to any messages sent to me.

SUBJECT: I currently have Office 2007 (and as a limited income retiree - find it impossible to upgrade to a newer version of Office) and would like to prepare/write some add-ins of the macros (VBA for both Word and Excel) that I have used and developed over the years. When I retired I lost the opportunity to use advanced versions of Visual Studio and have been limited to the "Express" versions of Visual Studio. With the recent release of Visual Studio 2013 Community there appears to be the possibility that I might be able to convert my macros and such to an add-in. Unfortunately, I haven't a clue where or even how to start.

I very much would appreciate any information, directions, suggestions, and ideas which might help me find a way to get started in providing an add-in which would span the various versions of Word and Excel between 2007 and the current version. (I am currently running Windows 8.1 but must admit I am not terribly impressed.)

I might note that my primary language for programming has been VB (as in VBA). I am not opposed to learning C# but rewriting everything would be a bit more inefficient than I would like to tackle at this point in time.

If there is some generous soul who would be kind enough to point me toward articles, samples/examples, and ideas on how I might be able to create these add-ins of my macros and such I would be deeply appreciative.

NOTE: After writing and posting this message, I realized I forgot to ask whether I need to obtain a copy of VSTO or whether the capabilities of VSTO had been incorporated into VS Community 2013. Apologize for updating this message so shortly after the original post. (Hope I won't make any more changes.)

David Schrader
dfschrader@comcast.net


David (Whose retirement hasn't been as exciting as I was lead to believe it would be.)



get loadbehaviour or the registry install location of an office addin

$
0
0

Hello,

I need to programmatically find out the load behavior of my addin ie. 0x3, 0x10, 0x9

If this is not possible I would like to find the location of where this information is stored ie. HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins\[addin name]) so that i can retrieve the load behaviour from there.

Any suggestions?


Custom properties of appointments on shared calendars having trouble synchronizing: "The function cannot be performed because the message has been changed"

$
0
0

Hi,

We have a timesheet add-in for Outlook that adds a form region to the Appointment form.  It saves data into custom properties of the open appointment.

We have an issue when sometimes a user will make a change to the data in an appointment on another user's shared calendar and the change will save on that user's computer, but it will not synchronize to the Exchange server (we are using Exchange 2007).

Going into the user's Sync Issues folder, we find Synchronization Logs that contain the following:

8:54:20 Synchronizing server changes in folder 'Joe Canterro - Calendar'

8:54:20 Downloading from server 'MAIL1.services.net.au'

8:54:21    1 view(s)/form(s) updated in offline folder

8:54:21 Error synchronizing folder

8:54:21                 [80040109-50A-80040109-560]

8:54:21                 The function cannot be performed because the message has been changed.

8:54:21                 Microsoft Exchange Information Store

8:54:21                 For more information on this failure, click the URL below:

8:54:21                 http://www.microsoft.com/support/prodredirect/outlook2000_us.asp?err=80040109-50a-80040109-560

Is there a way to force synchronization, where we can get the add-in to choose which data overrides which?

ASP.Net Word Header not expanding for Image

$
0
0

I am attempting to insert(add) an .gif image to a Word template header. I am successfully getting the image in the header but the header doesn't expand so the first line of the main document is at the top of the page and overlays the image in the header.  Any assistance is appreciated!

Here's my code;

// Go to header/footer and insert image
public void GotoHeaderFooter(string path)
{

    object oTrue = true;
    object oFalse = false;
    object oMissing = System.Reflection.Missing.Value;
    object novalue = System.Reflection.Missing.Value;
    object missing = System.Reflection.Missing.Value;


    //adding header
    string logoPath = path + "image.gif";
    Microsoft.Office.Interop.Word.Shape logoCustom = null;
    oWordApplic.ActiveWindow.ActivePane.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekCurrentPageHeader;

    logoCustom = oWordApplic.Selection.HeaderFooter.Shapes.AddPicture(logoPath, ref oFalse, ref oTrue);
    logoCustom.Select(ref oMissing);
    logoCustom.Left = (float)Microsoft.Office.Interop.Word.WdShapePosition.wdShapeCenter;
    logoCustom.Top = (float)Microsoft.Office.Interop.Word.WdShapePosition.wdShapeCenter;
    logoCustom.WrapFormat.AllowOverlap = -1;
    logoCustom.WrapFormat.Side = Microsoft.Office.Interop.Word.WdWrapSideType.wdWrapBoth;
    logoCustom.WrapFormat.Type = Microsoft.Office.Interop.Word.WdWrapType.wdWrapNone;

    oWordApplic.ActiveWindow.ActivePane.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekMainDocument;
}


Remote Sharepoint Development With Visual Studio Ultimate 2013

$
0
0

Got a question..

My problem is (the age old one) remote development with Sharepoint in Visual Studio.  

Personally, I loathe Sharepoint Designer..  Id rather use IIS With Dreamweaver or Visual Studio or, failing that, stick a rusty screwdriver in my eye while using a text editor to script ASP.net....  Anyways..

i have a server running windows server 2008 with Sharepoint Foundation 2010 and, id like to develop remotely using my client machine running Windows 7 (Actually its a VRM on a Mac Pro but it sees the Server just fine when I connect using the Server explorer)... But when I go to create a Sharepoint Connection I get this error

" The Required version of Sharepoint Foundation 2010/2013 or Sharepoint Server 2010/2013 is not installed on this system.  Sharepoint must be installed on the local system to develop SharePoint solutions."

Obviously I don't want to use Visual studio for development directly on the server so is there any way to develop remotely using my client machine?

Thanks 


Opening a New Office 2007 Document using Visual Studio 2010

$
0
0

 

I've been attempting to open a Word 2007 document using Visual Studio 2010.  I'm not sure where I'm going wrong, this is my code so far:

Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim oWord As Word.Application Dim oDoc As Word.Document 'Start Word and open the document template. oWord = CreateObject("Word.Application") oWord.Visible = True oDoc = oWord.Documents.Add oWord = CreateObject("Word.Application") oWord.Visible = True oWord.WindowState = Word.WdWindowState.wdWindowStateMaximize 'this opens document. Use document file name in the open statement oWord.Documents.Open(txtFileName)

End Sub

 

 

End Class

The problem appears to be with the "Dim oWord As Word.Application" line.  Visual Studio is not recognizing "Word.Application".

Thank you.

 

 

 


James Hutchinson


How can I activate Built In Ribbon Tab (i.e. TabHome) from the custom ribbon tab ?

$
0
0

Yes, lots of informations are there about how to activate the custom tab from out there.

.

But, there are no such informations, How to activate the Built In Ribbon Tab (i.e. TabHome) from the custom ribbon tab.

.

I am with VS 2010, Word 2010, Win 8.1

.

I am not good at XMLs. Tell me with designer ways Please.

.

Thanks !





How can I finish a ribbon button control flow in the middle of that.

$
0
0

In MS Word VSTO custom ribbon tab, I have a button. 

And it has some kind of long codes.

I'd like to finish it at the some point.

I could use the code below;

System.Diagnostics.Process.GetCurrentProcess().Kill();   

.

But, It looks not so much good.

Because, it kills MS Word itself too.

.

What is the better code could be ?

.

(Yeah, we have "goto" command here, but, you know,

nobody recommends it, though I'm using it now.)

.

.

Regards




Userform initial startup help

$
0
0
Not sure if this the correct forum to post this question, but I am running VS2012 and selected Excel 2010 Workbook option under the new project. I then created a userform that I would like to appear first prior to the Excel spreadsheet. I select the Projects menu--->[Project Name] Properties--->Application Tab. However, the "startup object" drop down is grayed out. How can I display the userform prior to the Excel Spreadsheet? Thank you.

How to include Facebook SSO in C# .NET? (Particularly for an Outlook Addin)

$
0
0

Hi,

I have a requirement of authenticating a Facebook user through Facebook SSO for my Outlook Add-In. Is there a Facebook SDK to work with .NET? Particularly the way of generating the access tokens for the App. I seen some of third party SDKs like: http://facebooksdk.net/ . But they only support Windows Phone Apps. How can I include this for my Outlook Add-In?

Thanks in advance.


Thanks Prasad

Excel quit event

$
0
0

Hi,

I'm writing the addon which is counting time which user has spend in Excel/Word ... with Word i had no problem, because there is a Quit event which i'm using, but Excel doesn't provide that kind of events. Is there any workaround that i can use?

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

What about Macs?

$
0
0
Hi,

Is there any way to port my Office VSTO customization to Apple Mac platform? I'm completely ignorant about macs, and now I am asked about it, and I need help.

So, is there the equivalent MS Office 2003 for Mac which supports customizations and also whether there is .NET framework for Mac that can run VSTO assemblies?

Thanks

Keeping windows form on top within Excel application but not TopMost

$
0
0

I'm trying to convert an Excel VBA workbook to a VSTO Add-in in VB.NET.  In the original (i.e.- VBA) version I have a modeless UserForm (called frmMain) that floats on top and is visible at all times while the user is still within the Excel application, but is not visible if the user moves to another window outside of Excel.

For example, within Excel the user can click on any worksheet tab, select any cell, etc. and the UserForm is still visible.  This is exactly how I want it.

The problem is, that in the new VSTO add-in, I can not get the Windows form to mimick this same behavior.  I use frmMain.Show() to show the form as a modeless form, but the moment the user clicks an Excel worksheet (i.e.- activates a worksheet) the form becomes hidden behind the worksheet.  I can manually Alt-Tab to bring the form back into view, but I need it to always remain in view - floating on top of the Excel worksheets so long as the user hasn't left the Excel aplication.

I tried various things, including setting the form to TopMost, however, that causes the form to be TopMost everywhere - including outside of Excel.  Worse than that, if the user does anything that would normally result in Excel's launching a dialog box (e.g.- closing an open workbook, raising the alert "Do you want to save the changes...") the alert dialog box itself is hidden and inaccessible behind the frmMain form (since the frmMain is TopMost).

How can I get my form to behave in the desired way (i.e.- the same way it did in VBA)?

Thanks!!!

Rob


Rob Shurman

Error in accessing the Word.Document: System.Runtime.InteropServices.COMException (0x800A11FD): This method or property is not available because the document is locked for editing. at Microsoft.Office.Interop.Word.FontClass.set_Size(Single prop)

$
0
0

Hi,

I am trying to edit the body of an appointment item programmatically by accessing Word.Document. I am getting the following error on an Outlook 2007 SP3 machine:

System.Runtime.InteropServices.COMException (0x800A11FD): This method or property is not available because the document is locked for editing.
   at Microsoft.Office.Interop.Word.FontClass.set_Size(Single prop).

May anyone please give a clue why this exception is thrown?

Thanks in advance.


Thanks Prasad


Word Add-In breaks Word Cound / Page Position

$
0
0
Hi,
I've developed a Word Add-In using VS2013.
I see that when the Add-In is activated, Word stops displaying the Word Count and Page Position at the bottom of the page.
Needless to say, I have no code in the Add-In that deals with Word Count or Page Position.
This problem occurs on Word 2007/2010/2013.
Any idea what can cause that?
Thanks!

Regarding Words default normal .dotm

$
0
0

Hi All,

Is there a method to restore words default normal.dotm file  as soon as the add in loads? and delete the existing user created .dotm file? using c# or vba?

Regards,

Apoorva

How can I use the Button I make on a Document at run-time from VSTO Word AddIn.

$
0
0

Hi, here comes the beginner again.

I confirmed that the following codes working fine with me;

Document  DoCuMeNT = Globals.Factory.GetVstoObject( Globals.ThisAddIn.Application.ActiveDocument );
Microsoft.Office.Tools.Word.Controls.Button  BuTToN ;                    
DoCuMeNT.Paragraphs[1].Range.InsertParagraphBefore();
BuTToN  =  DoCuMeNT.Controls.AddButton( DoCuMeNT.Paragraphs[1].Range, 120, 28, "BuTTon1" );
BuTToN.Text = "Testing...";

Thanks for the MSDN !!

But, that is all.

Can you tell me how to use the button?

Now, I click it, it makes not any kind of action, it is just out there smiling at me.

Thanks






MS word Serilization

$
0
0

Seeking understand and help to serializing MS-word and .pdf documents.

What I do understand:

  • 10 digit system to start
  • Include date (02-15)
  • Include numerical category in front (0-10)
  • Include numerical series generator at end (-#####)
  • Include this unique s/n on the document and file name (for search)
  • The index is by numerical category

May big question is :

Does MS-word already have a document serial number generator? Or

How can we write a script for MS-word to do is function?

WPF ComboBox behavior affected when hosted in a task pane

$
0
0

I have a VSTO Excel 2010 ribbon add-in that has a task pane. The task pane programmatically adds a WPF user control, which in turn contains an ElementHost that contains a simple user control with a single WPF ComboBox.  (We have other task panes that do not have comboboxes, and they are working just fine.)

I've encountered problems with selecting items from the WPF ComboBox in the task pane that I don't have when using the same WPF ComboBox in, say, a WPF Application.  For example:

WPF Application:

        public MainWindow()
        {
            InitializeComponent();

            comboBox1.Items.Add("One");
            comboBox1.Items.Add("Two");
            comboBox1.Items.Add("Three");
        }

        private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            textBlock1.Text = comboBox1.SelectedItem.ToString();
        }

Selecting the last item behaves as expected:

Same control hosted in task pane:

Inside the task pane, I can select the first or second item. But the third item, while visible, is not selectable.

Is there a workaround/fix for this behavior? 

In my Web searching so far, I've seen a few references to removing the WS_CHILD style for the task pane as a way to correct odd control behaviors -- but these were regarding third-party controls, not standard WPF controls like the ComboBox.  And it was not clear to me how, specifically, one could remove the WS_CHILD style for a standard VSTO Excel 2010 task pane's hosted controls.

Viewing all 5157 articles
Browse latest View live


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