Copy data from Word macro to excel

R

Rusty_nl

I am working on a combined Word and Excel sheet (Both 2000 version)

What I am trying to do is capture information in Word in an Userform
The information that is entered in the form is then used to fill out
word document that can be send to a customer.

However this information also needs to be entered into an excel sheet
currently that is done manually. But I would like to automate that wit
a macro.

The data that is being captured is in the following form:

-If bolOKButtonPressed Then

WordBasic.SetDocumentProperty "ProjectTitle", 0
UserForm1.ProjectTitle.Value, 2
WordBasic.SetDocumentProperty "PAnummer", 0
UserForm1.PAnummer.Value, 2
WordBasic.SetDocumentProperty "CompanyName", 0
UserForm1.CompanyName.Value, 2
WordBasic.SetDocumentProperty "CompanyStreet", 0
UserForm1.CompanyStreet.Value, 2
WordBasic.SetDocumentProperty "ZipCode", 0, UserForm1.ZipCode.Value
2
WordBasic.SetDocumentProperty "CompanyCity", 0
UserForm1.CompanyCity.Value, 2
WordBasic.SetDocumentProperty "ContactPerson", 0
UserForm1.ContactPerson.Value, 2
WordBasic.SetDocumentProperty "PhoneNumberTech", 0
UserForm1.PhoneNumberTech.Value, 2

temp_InvoiceCompany
WordBasic.[GetDocumentProperty$]("InvoiceCompany")
temp_InvoiceStreet
WordBasic.[GetDocumentProperty$]("InvoiceStreet")
temp_ZipCodeInvoice
WordBasic.[GetDocumentProperty$]("ZipCodeInvoice")
temp_InvoiceCity = WordBasic.[GetDocumentProperty$]("InvoiceCity")
temp_ContactPersonInvoice
WordBasic.[GetDocumentProperty$]("ContactPersonInvoice")
temp_PhoneNumberInvoice
WordBasic.[GetDocumentProperty$]("PhoneNumberInvoice")
' temp_Conslevel0 = WordBasic.[GetDocumentProperty$]("Conslevel0")
temp_Conslevel1 = WordBasic.[GetDocumentProperty$]("Conslevel1")
temp_Conslevel2 = WordBasic.[GetDocumentProperty$]("Conslevel2")
temp_Conslevel3 = WordBasic.[GetDocumentProperty$]("Conslevel3")
temp_Conslevel4 = WordBasic.[GetDocumentProperty$]("Conslevel4")
temp_Conslevel5 = WordBasic.[GetDocumentProperty$]("Conslevel5")

' MsgBox ("temp_Conslevel1 is GetDocProp-Conslevel1")

' If UserForm1.Conslevel1.Value = temp_Conslevel1 Then
' WordBasic.SetDocumentProperty "Conslevel1", 0, Conslevel1.Value
2
' Else
' WordBasic.SetDocumentProperty "Conslevel1", 0
UserForm1.Conslevel1.Value, 2
' End If

' MsgBox ("Conslevel1")

temp_hrrate1 = WordBasic.[GetDocumentProperty$]("hrrate1")
temp_hrrate2 = WordBasic.[GetDocumentProperty$]("hrrate2")
temp_hrrate3 = WordBasic.[GetDocumentProperty$]("hrrate3")
temp_hrrate4 = WordBasic.[GetDocumentProperty$]("hrrate4")
temp_hrrate5 = WordBasic.[GetDocumentProperty$]("hrrate5")-

What I need to copy into excel is particularly the
- temp_Conslevel1 = WordBasic.[GetDocumentProperty$]("Conslevel1")
temp_Conslevel2 = WordBasic.[GetDocumentProperty$]("Conslevel2")
temp_Conslevel3 = WordBasic.[GetDocumentProperty$]("Conslevel3")
temp_Conslevel4 = WordBasic.[GetDocumentProperty$]("Conslevel4")
temp_Conslevel5 = WordBasic.[GetDocumentProperty$]("Conslevel5")-

bit. However I am not really good in word so if anyone has an idea o
how to copy this info to excel that would be really helpful.

PS. the word document with the macro has been made by someone else,
am trying to add in the copy to excel bit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top