This commit is contained in:
77
PROMS/proms/Volian.Utils.Library/MSWord/MSWord.csproj
Normal file
77
PROMS/proms/Volian.Utils.Library/MSWord/MSWord.csproj
Normal file
@@ -0,0 +1,77 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{2F79D7F9-885E-4441-99F3-045D7612B2E5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MSWord</RootNamespace>
|
||||
<AssemblyName>MSWord</AssemblyName>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\..\..\veproms\bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="WordDoc.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Include="Microsoft.Office.Core">
|
||||
<Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
|
||||
<VersionMajor>2</VersionMajor>
|
||||
<VersionMinor>3</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Include="VBIDE">
|
||||
<Guid>{0002E157-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>5</VersionMajor>
|
||||
<VersionMinor>3</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Include="Word">
|
||||
<Guid>{00020905-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>8</VersionMajor>
|
||||
<VersionMinor>3</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
10
PROMS/proms/Volian.Utils.Library/MSWord/MSWord.csproj.vspscc
Normal file
10
PROMS/proms/Volian.Utils.Library/MSWord/MSWord.csproj.vspscc
Normal file
@@ -0,0 +1,10 @@
|
||||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = "relative:Volian.Utils.Library\\MSWord"
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("MSWord")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Volian Enterprises, Inc.")]
|
||||
[assembly: AssemblyProduct("MSWord")]
|
||||
[assembly: AssemblyCopyright("Copyright © Volian Enterprises, Inc. 2006")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("d96766ab-573a-470e-8104-d862880d1cd7")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
112
PROMS/proms/Volian.Utils.Library/MSWord/WordDoc.cs
Normal file
112
PROMS/proms/Volian.Utils.Library/MSWord/WordDoc.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
using Microsoft.Office.Interop;
|
||||
using Microsoft.Office.Interop.Word;
|
||||
|
||||
namespace Volian.MSWord
|
||||
{
|
||||
public class WordDoc
|
||||
{
|
||||
private object optional = Missing.Value;
|
||||
private object oFalse = false;
|
||||
private object oTrue = true;
|
||||
private object oBlank = "";
|
||||
private object oWdStory = WdUnits.wdStory;
|
||||
private object oWdWord = WdUnits.wdWord;
|
||||
private object oWdChar = WdUnits.wdCharacter;
|
||||
private object oWdLine = WdUnits.wdLine;
|
||||
private object oWdPara = WdUnits.wdParagraph;
|
||||
private object oWdExtend = WdMovementType.wdExtend;
|
||||
private object oWdMove = WdMovementType.wdMove;
|
||||
private object o1 = 1;
|
||||
private Application m_App;
|
||||
// Microsoft.Office.Interop.Word.Application App
|
||||
// {
|
||||
// get{return m_App;}
|
||||
// }
|
||||
private Document m_Doc;
|
||||
// Microsoft.Office.Interop.Word.Document Doc
|
||||
// {
|
||||
// get{return m_Doc;}
|
||||
// }
|
||||
private string mDocName;
|
||||
|
||||
public string DocName
|
||||
{
|
||||
get { return mDocName; }
|
||||
set { mDocName = value; }
|
||||
}
|
||||
public WordDoc(string sPath)
|
||||
{
|
||||
m_App = new ApplicationClass();
|
||||
//m_App.Visible = true;
|
||||
mDocName = sPath;
|
||||
object oFile = sPath;
|
||||
m_Doc = m_App.Documents.Open(
|
||||
ref oFile // FileName
|
||||
,ref optional // ConfirmConversions
|
||||
,ref optional // ReadOnly
|
||||
,ref optional // AddToRecentFiles
|
||||
,ref optional // PasswordDocument
|
||||
,ref optional // PasswordTemplate
|
||||
,ref optional // Revert
|
||||
,ref optional // WritePasswordDocument
|
||||
,ref optional // WritePasswordTemplate
|
||||
,ref optional // Format
|
||||
,ref optional // Encoding
|
||||
,ref optional // Visible
|
||||
,ref optional // OpenAndRepair
|
||||
,ref optional // DocumentDirection
|
||||
,ref optional // NoEncodingDialog
|
||||
,ref optional // XMLTransform
|
||||
);
|
||||
}
|
||||
//~WordDoc()
|
||||
//{
|
||||
// m_App.Quit(ref oFalse, ref optional, ref optional);
|
||||
//}
|
||||
private string SaveDoc()
|
||||
{
|
||||
object oFileName = mDocName;
|
||||
object oFileFormat = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatDocument;
|
||||
//object oFileFormat = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatFilteredHTML;
|
||||
object oPassWord = "";
|
||||
try
|
||||
{
|
||||
m_Doc.SaveAs2000(
|
||||
ref oFileName // FileName
|
||||
,ref oFileFormat // FileFormat
|
||||
,ref oFalse // LockComments
|
||||
,ref oPassWord // Password
|
||||
,ref oFalse // AddToRecentFiles
|
||||
,ref oPassWord // WritePassword
|
||||
,ref oFalse // ReadOnlyRecommended
|
||||
,ref oFalse // EmbedTrueTypeFonts
|
||||
,ref oFalse // SaveNativePictureFormat
|
||||
,ref oFalse // SaveFormsData
|
||||
,ref oFalse // SaveAsAOCELetter
|
||||
);
|
||||
return "Successful Save";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return string.Format("Error during Doc save - {0}", ex.Message);
|
||||
}
|
||||
}
|
||||
public string Save()
|
||||
{
|
||||
return SaveDoc();
|
||||
}
|
||||
public string Save(string sPath)
|
||||
{
|
||||
mDocName = sPath;
|
||||
return SaveDoc();
|
||||
}
|
||||
public void Close()
|
||||
{
|
||||
m_App.Quit(ref oFalse, ref optional, ref optional);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user