Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[c#] Word Briefschutz wdAllowOnlyFormField

Empfohlene Antworten

Veröffentlicht

Hallo zusammen,

ich habe eine Klasse erstellt, welche mir Word Vorlagen laden und verarbeiten soll.

Beim Aufruf eines Dokuments mache ich folgendes:

                this.doc = word.Documents.Add(path + this.id + ".DOC", Missing.Value, Missing.Value, Missing.Value);

                this.doc.BuiltInDocumentProperties("Title").Value = this.id + ".doc";

                this.useVars();

                this.doc.Protect(Microsoft.Office.Interop.Word.WdProtectionType.wdAllowOnlyFormFields, Missing.Value, "test", Missing.Value, Missing.Value);

                this.show();
useVars() setzt per Schleife automatisch alle FormFelder im Dokument um. show() ist lediglich dafür da Word in den Vordergrund zu rufen.
        // Dokument anzeigen

        private void show()

        {

            this.word.Visible = true;

        }

Vorhandene FormFields werden nicht gefüllt, sondern ersetzt, um sie nach dem automatischen Füllen vor Veränderung zu stützen. Nicht gefüllte FormFields sollen danach aber noch füllbar sein.

Wenn ich als ProtectionType wdAllowOnlyReading benutze, kann ich nichts mehr machen (so wie es dann auch sein sollte), bei wdAllowOnlyFormFields jedoch nicht. In diesem Fall kann ich fröhlich im Dokument rumschreiben wie es mir gerade gefällt.

Mache ich einen massiven Fehler, habe ich etwas falsch verstanden, oder ist wdAllowOnlyFormField nicht der Status, dass man nur noch in FormFields schreiben darf?

Ich verzweifle gerade etwas.

Gruß

Shadowman

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.