Toon posts:

[Word97] BestandOpslaan aanpassen

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik wil in Word97 een form starten voordat een document opgeslagen wordt. Nu schijnt het zo te zijn dat als je een eigen functie schrijft met de naam van het originele opslaan functie (BestandOpslaan, BestandOpslaanAls) eerst de eigen functie wordt uitgevoerd. Ik krijg het niet voor elkaar, ik heb in een module deze functies geschreven maar ze worden niet aangeroepen. Op MSDN en hier kan ik verder niets vinden. Heeft iemand ervaring hiermee?

  • Lustucru
  • Registratie: Januari 2004
  • Niet online

Lustucru

26 03 2016

Klok en klepel: de module heeft de naam van de te vervangen methode en de subroutine zelf heet stomweg 'main'.

De oever waar we niet zijn noemen wij de overkant / Die wordt dan deze kant zodra we daar zijn aangeland


Verwijderd

Topicstarter
Ok, ik heb de module nu de naam BestandOpslaan gegeven en in deze module staat de volgende code:

Option Explicit
Sub main()
MsgBox "test"
End Sub

Maar hij pakt dit nog niet.....

  • Lustucru
  • Registratie: Januari 2004
  • Niet online

Lustucru

26 03 2016

had even gekeken hoe het hier stond, maar je mag ook de procedurenaam gebruiken. Let wel op taalvarianten:
Modifying Word Commands

You can modify most Word commands by turning them into macros. For example, you can modify the Open command on the File menu so that instead of displaying a list of Word document files (in Windows, files ending with the .doc file name extension), Word displays every file in the current folder.

To display the list of built­in Word commands in the Macro dialog box (Tools menu), click Word commands in the Macros in box. Every available menu, toolbar, and shortcut key command is listed in this box. Each menu command begins with the menu name associated with that command. For example, the Save command on the File menu is listed as FileSave.

You can replace a Word command with a macro by giving a macro the same name as the Word command. For example, if you create a macro named "FileSave," Word runs this macro when you do any of the following: click Save on the File menu, click the Save button on the Standard toolbar, or press the shortcut key assigned to FileSave.

To modify a Word command


On the Tools menu, point to Macro, and then click Macros.

In the Macros in box, click Word Commands.

In the Macro name box, click the Word command you want to modify (for example, FileSave).

In the Macros in box, select a template or document location where you want to store the macro. For example, click Normal.dot (global template) to create a global macro (the FileSave command will be automatically modified for all documents).

Click Create.

The Visual Basic Editor opens with a module displayed that contains a new procedure whose name is the same as the command you clicked. If you clicked the FileSave command, the FileSave macro appears as shown in the following example.

Sub FileSave()
'
' FileSave Macro
' Saves the active document or template
'
ActiveDocument.Save

End Sub


You can add additional instructions or remove the existing ActiveDocument.Save instruction. Every time the FileSave command runs, your FileSave macro runs instead of the Word command. To restore the original FileSave command, you need to rename or delete your FileSave macro.

Note You can also replace a Word command by creating a code module whose name is the same as the Word command (for example, FileSave) with a subroutine named "Main."
bron:msdn

De oever waar we niet zijn noemen wij de overkant / Die wordt dan deze kant zodra we daar zijn aangeland


Verwijderd

Topicstarter
Ik heb op msdn een paar uur lopen zoeken maar het ligt er natuurlijk aan hoe je zoekt, blijkbaar gebruikte ik minder voor de hand liggende zoektermen.

In ieder geval bedankt........

Verwijderd

Topicstarter
Ah lekker, kom er nu achter dat beveiligt is hier op het werk. Ik kan de bestaande macro's niet wijzigen. Weet iemand welke instelling dat is, dan kan ik bij beheer vragen of ze die instelling eraf halen (ze weten zelf niet welke instelling dat is omdat het een standaard image is)..........

Verwijderd

Topicstarter
Verwijderd schreef op 02 augustus 2004 @ 14:52:
Ah lekker, kom er nu achter dat beveiligt is hier op het werk. Ik kan de bestaande macro's niet wijzigen. Weet iemand welke instelling dat is, dan kan ik bij beheer vragen of ze die instelling eraf halen (ze weten zelf niet welke instelling dat is omdat het een standaard image is)..........
Ik ben een paar dagen aan het zoeken geweest maar heb nog steeds niet kunnen vinden waar deze instelling opgelsgen wordt (ik heb de normal.dot weg gegooid en in de registry de DATA entry maar blijkbaar wordt deze instelling daar niet opgeslagen). Heeft iemand enig idee?

  • Lustucru
  • Registratie: Januari 2004
  • Niet online

Lustucru

26 03 2016

Ik snap niet eens wat je bedoelt. Wat bedoel je met bestaande macro's wijzigen? Hoe ben je er dan achter gekomen dat het niet kan vanwege een beveiligingsinstelling? Krijg je een foutmelding ofzo? Vziw kent word97 geen beveiliging tegen het afvangen van ingebouwde functies.

De oever waar we niet zijn noemen wij de overkant / Die wordt dan deze kant zodra we daar zijn aangeland

Pagina: 1