Avatar billede rubber Nybegynder
31. januar 2002 - 16:14 Der er 10 kommentarer og
1 løsning

Indsætte data fra et word dok. til en access db

I want to grep the Author name from a word doc and insert the Auther name into a database to keep track of who write what doc.
Database has to columns a counter and name.

Jeg har bare oprettet spørgsmålen på en engelsk, da jeg har fået mange svar på Engelsk.
Avatar billede terry Ekspert
31. januar 2002 - 19:12 #1
he rubber>thats very kind of you :o)
You can NOT grep after the author property. I have actually looked at the original question and tried to find a solution, but I just DO NOT seem to be able to find this propery.

A solution will involve automating Word and opening the documnet I think, but as I said I just do NOT seem to be able to find out exactly where the author property is hidden.
Avatar billede rubber Nybegynder
31. januar 2002 - 20:13 #2
That about VB with I am not familiar with. Do you know anything about that??
Avatar billede terry Ekspert
31. januar 2002 - 20:15 #3
I can open a Word document from VB but I can NOT find the author!
Avatar billede rubber Nybegynder
31. januar 2002 - 20:26 #4
Is it possible in VB to grep a whole document and insert it into access on save command??
31. januar 2002 - 21:59 #5
Følgende kode åbner et dokument og skriver Auther i en msgbox:

Public Sub OpenWord()
  Dim Wrd As New Word.Application
  Wrd.Visible = True
  Wrd.Activate
  Wrd.Documents.Open "E:\Dokumenter\WORD\Test.doc"
  MsgBox Wrd.Documents(1).BuiltInDocumentProperties(3)
  Set Wrd = Nothing
End Sub

/Thomas
www.makeiteasy.dk
31. januar 2002 - 23:07 #6
Nedenstående er måske lidt mere 'korrekt':

Public Sub OpenWord()
  Dim Wrd As New Word.Application
  Wrd.Visible = True
  Wrd.Activate
  Wrd.Documents.Open "E:\Dokumenter\WORD\bilsalg.doc"
  Debug.Print Wrd.ActiveDocument.BuiltInDocumentProperties("Author")
  Set Wrd = Nothing
End Sub
Avatar billede terry Ekspert
01. februar 2002 - 08:43 #7
strange! I just wrote a commentand its gone :o( I think eksperten has a problem somewhere!

short version>
I was in the same area yesterday Thomas, but just could NOT find it, but then there are loads of objects/properties in the object browser and it would have taken me all day :o)
01. februar 2002 - 08:47 #8
Hi Terry,

You should have looked in Word VB-help. Took me 3 minuttes ;o)
Avatar billede terry Ekspert
01. februar 2002 - 08:58 #9
How do you get in there Thomas? I have most probably been told on some course but can rememeber. But I thought I had been almost everywhere but still...
Anyway hopefully rubber glove has the answer he wanted :o)
Avatar billede rubber Nybegynder
01. februar 2002 - 09:08 #10
Takker for Jeres svar! Skal lige have det til at virke så deler jeg point ud
01. februar 2002 - 09:15 #11
Hvis du ikke ønsker at se Word, kan du gøre sådan:

Public Sub OpenWord()
  Dim Wrd As New Word.Application
  Wrd.Documents.Open "E:\Dokumenter\WORD\Test.doc"
  Debug.Print Wrd.ActiveDocument.BuiltInDocumentProperties("Author")
  Wrd.ActiveDocument.Close False
  Wrd.Quit
  Set Wrd = Nothing
End Sub
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester