using
namespace
{
((Microsoft.Office.Interop.Word.
Application.WindowActivate +=
Application.DocumentOpen +=
}
#region
#endregion
AppCommandBar = CreateCommandBar(
cbbSaveData = CreateCommandBarButton(
cbbSaveData.Click +=
namevar++;
namevar_2 = namevar.ToString();
flnm = path;
Data_File_Name(filename);
docname = Microsoft.Office.Interop.Word.
compline = sr.ReadLine();
asConfigText[0] = compline.Split(
filename = asConfigText[2];
sr.Close();
}and the output looks like this:
------ Build started: Project: Form Commands, Configuration: Debug Any CPU ------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /warn:4 /define:DEBUG;TRACE /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Accessibility.dll /reference:"c:\Program Files\Common Files\Microsoft Shared\VSTO\8.0\Microsoft.Office.Tools.Common.dll" /reference:"c:\Program Files\Common Files\Microsoft Shared\VSTO\8.0\Microsoft.VisualStudio.Tools.Applications.Runtime.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll /reference:C:\WINDOWS\assembly\GAC\Office\11.0.0.0__71e9bce111e9429c\Office.dll /reference:C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Word\11.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll /reference:C:\WINDOWS\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll /debug+ /debug:full /optimize- /out:"obj\Debug\Save Doc Button.dll" /resource:obj\Debug\Save_Doc_Button.Properties.Resources.resources /target:library Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs ThisAddIn.cs ThisAddIn.Designer.cs
\\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs(32,175): error CS0103: The name 'Application_NewDocument' does not exist in the current context
\\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs(33,123): error CS0103: The name 'Application_WindowActivate' does not exist in the current context
\\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs(34,119): error CS0103: The name 'Application_DocumentOpen' does not exist in the current context
\\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs(58,27): error CS0103: The name 'CreateCommandBarButton' does not exist in the current context
\\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs(96,13): error CS1501: No overload for method 'Data_File_Name' takes '1' arguments
\\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs(71,23): (Related location)
\\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs(97,45): error CS0117: 'Microsoft.Office.Interop.Word.Document' does not contain a definition for 'save'
\\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs(109,23): error CS0120: An object reference is required for the nonstatic field, method, or property 'Microsoft.Office.Interop.Word._Document.Name.get'
c:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Word\11.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Word.dll: (Related file)
Compile complete -- 7 errors, 0 warnings
------ Skipped Build: Project: Save Doc ButtonSetup, Configuration: Debug ------
Project not selected to build for this solution configuration
========== Build: 0 succeeded or up-to-date, 1 failed, 1 skipped ==========And the error list looks like this:Error 1 The name 'Application_NewDocument' does not exist in the current context \\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs 32 175 Form CommandsError 2 The name 'Application_WindowActivate' does not exist in the current context \\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs 33 123 Form CommandsError 3 The name 'Application_DocumentOpen' does not exist in the current context \\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs 34 119 Form CommandsError 4 The name 'CreateCommandBarButton' does not exist in the current context \\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs 58 27 Form CommandsError 5 No overload for method 'Data_File_Name' takes '1' arguments \\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs 96 13 Form CommandsError 6 'Microsoft.Office.Interop.Word.Document' does not contain a definition for 'save' \\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs 97 45 Form CommandsError 7 An object reference is required for the nonstatic field, method, or property 'Microsoft.Office.Interop.Word._Document.Name.get' \\file1\mis\dheald\My Documents\Visual Studio 2005\Projects\Save Doc Button\Save Doc Button\ThisAddIn.cs 109 23 Form CommandsThey never really taught this stuff in school, and I'm having a hard time pinning down a good reference document for how to do this stuff. Alot of the code is adapted from a project done by a coworker, but he's not here to ask what I did wrong. Not sure when or if he'll be back since he's a contractor.