Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
Warum sollten die bescheuert sein, nur weil sie das zulassen? MS macht das doch schon seit Jahren so, dass man als "Drittanbieter" auf Funktionen aus MS-Anwendungen zugreifen kann. Aus gutem Grund, denn wenn Drittanbieter ein "kleines Tool" entwickeln, das auf Word (beispielsweise) basiert, muss der Anwender erst einmal das komplette Word-Paket installiert haben, bevor er das eigentliche 500kb-Progrämmchen nutzen kann, das er haben wollte - ob er Word braucht oder nicht, spielt dabei keine Rolle.Wenn die bescheuert sind lassen die es zu.
using Microsoft.Office.Interop.Word;
using System;
using System.Collections;
using System.Reflection;
namespace Tools.Text
{
///<summary>
/// <para>
/// Die Klasse <c>SpellCheck</c> überprüft die Rechtschribung des Wordes
/// bzw. Textes.
/// </para>
///</summary>
public sealed class SpellCheck
{
private SpellCheck() {}
///<summary>
/// <para>
/// Überprüft das Word bzw. den Text, ist ein Fehler im Word bzw.
/// Text, werden die Korrekturvorschläge als ArrayList zurückgegeben.
/// </para>
///</summary>
///<remarks>
/// <para>
/// Es kann nicht mit <see langword="null"/> und ein lehren Stringarray
/// Initialisiert werden.
/// </para>
///</remarks>
///<param name="word">
/// Ein <see cref="System.String">Word</see>.
///</param>
///<returns>
/// <para>
/// Wenn ein Fehler auftritt werden Korrekturvorschläge als ArrayList
/// zurückgegeben, ansonsten <see langword="null"/>.
/// </para>
///</returns>
///<exception cref="System.ArgumentNullException">
/// <paramref name="word"/> ist <see langword="null"/>.
///</exception>
///<exception cref="System.ArgumentException">
/// <paramref name="word"/> keine Buchstaben in diesem
/// <see cref="System.String"/>.
///</exception>
public static ArrayList CheckSpelling(string word)
{
if(word == null)
throw new ArgumentNullException("String is null");
if(word.Length == 0)
throw new ArgumentException("No Letters in this String");
ApplicationClass winword = new ApplicationClass();
object o = Missing.Value;
ArrayList correctWords = null;
if(!winword.CheckSpelling(word, ref o, ref o, ref o, ref o,
ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o))
{
correctWords = new ArrayList();
winword.Documents.Add(ref o,ref o,ref o,ref o);
SpellingSuggestions sp = winword.GetSpellingSuggestions(word, ref o, ref o,
ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o, ref o);
foreach(SpellingSuggestion s in sp)
correctWords.Add(s.Name);
}
winword.Quit(ref o,ref o,ref o);
return correctWords;
}
}
}