Toon posts:

Userform word,VSB

Pagina: 1
Acties:
  • 43 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik heb een prima werkend userform maar ik moet meer inforrmatie daarop kwijt, dus wil graag nadat ik op de button ok heb geklikt naar het tweede userform gaan waarop ik deze info kwijt kan.

Nadat ik op het tweede userform heb geklik mag pas de data in het wordformulier worden ingevoerd:
wie weet hoe dat moet? of weet de goede site op het internet?

code in VSB tot nu toe:

Option Explicit
'#####################################################################
Private Sub UserForm_Initialize()
'#####################################################################
'
' Initialise the form
'
' We can preset the form with certain values.
'
' get the 'from' data from the registry
'
tbeigenaar.Text = GetSetting("webhaas", "briefsjabloon", "eigenaar")

'
' set the date
'
tbDate.Text = Format(Date, "d mmmm yyyy")

'
'
' Initialise the Delivery list
'
cbbetreft.AddItem "Offerte"
cbbetreft.AddItem "Aanbieding"
cbbetreft.AddItem "Mailing"
cbbetreft.AddItem "Bevestiging"

End Sub
'#####################################################################
Private Sub cmdOK_Click()
'#####################################################################
'
' The OK button has been pressed
'
' now lets get the data from the form and put it into the letter
'
' Set the bookmark text property to the data from the form
' - here's how...


ActiveDocument.Bookmarks("referentie").Range.Text = tbreferentie.Text
ActiveDocument.Bookmarks("Date").Range.Text = tbDate.Text
ActiveDocument.Bookmarks("naam").Range.Text = tbnaam.Text
ActiveDocument.Bookmarks("bedrijf").Range.Text = tbbedrijf.Text
ActiveDocument.Bookmarks("straat").Range.Text = tbstraat.Text
ActiveDocument.Bookmarks("huisnummer").Range.Text = tbhuisnummer.Text
ActiveDocument.Bookmarks("postcode").Range.Text = tbpostcode.Text
ActiveDocument.Bookmarks("woonplaats").Range.Text = tbwoonplaats.Text
ActiveDocument.Bookmarks("betreft").Range.Text = cbbetreft.Text
ActiveDocument.Bookmarks("onderwerp").Range.Text = tbonderwerp.Text
ActiveDocument.Bookmarks("aanhef").Range.Text = "Geachte " + tbnaam.Text + ","
ActiveDocument.Bookmarks("mvg").Range.Text = "Met vriendelijke groet"

Selection.GoTo What:=wdGoToBookmark, Name:="Closing"
'
' Check the 'value' of the option button to know which is selected
'

ActiveDocument.Bookmarks("eigenaar").Range.Text = tbeigenaar.Text

'
' remember 'from' for next time
'
SaveSetting "webhaas", "briefsjabloon", "eigenaar", tbeigenaar.Text

'---------------set the document properties -----------------------------
ActiveDocument.BuiltInDocumentProperties(wdPropertySubject) = tbonderwerp.Text
ActiveDocument.BuiltInDocumentProperties(wdPropertyCategory) = "Letter"
ActiveDocument.BuiltInDocumentProperties(wdPropertyKeywords) = "CDEV Computing LETTER Our Ref: " + tbreferentie.Text


' lets maximise the document on the screen

ActiveWindow.View.Type = wdPageView
ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit


' lets take the user to the start point so they can start typing
Selection.GoTo What:=wdGoToBookmark, Name:="text"

'
' unload (hide) the form
'
Unload Me


' THATS IT!
End Sub


'#####################################################################
Private Sub cmdCancel_Click()
'#####################################################################
'
' unload (hide) the form
'
Unload Me
End Sub

  • Spider.007
  • Registratie: December 2000
  • Niet online

Spider.007

* Tetragrammaton

webhaas, welkom op GoT :)

Dit topic lijkt me een programmeertopic; iets wat niet zo goed in Software Algemeen past; maar beter in een forum als Programming & Webscripting. Daarnaast komt dit topic op mij nogal over of je even snel een probleem door ons opgelost wil zien worden. Zoals je ongetwijfeld ook in Policy: Alle regels die op het forum gelden bent tegengekomen zien we graag dat je wat moeite doet voor je een topic opent; en dat je ook even verteld wat je precies al gedaan hebt. Ik stel voor dat je kijkt of je je probleem misschien zelf op kun lossen; of post anders even een topic in Programming & Webscripting waarbij je bovenstaande tips in je achterhoofd houdt :)

---
Prozium - The great nepenthe. Opiate of our masses. Glue of our great society. Salve and salvation, it has delivered us from pathos, from sorrow, the deepest chasms of melancholy and hate


Dit topic is gesloten.