Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Using InputBox to capture and re-use information in Word?

Posted on 2006-03-31
6
Medium Priority
?
171 Views
Last Modified: 2010-04-07
How do I use an InputBox to capture information and use it to populate the Document Properties in a Word Document?
0
Comment
Question by:yecala
  • 2
3 Comments
 
LVL 77

Expert Comment

by:GrahamSkan
ID: 16341097
This code uses early binding for most of the objects, so set a reference to the Microsoft Word object library.
0
 
LVL 77

Accepted Solution

by:
GrahamSkan earned 1000 total points
ID: 16341100
Well this code does, anyway.

Private Sub SetPropertyValue(strDoc As String)
    Dim oDoc As Word.Document
    Dim oWord As Word.application
    Dim strPropValue As String
    Dim oDpr As Object 'DocumentProperty
    Set oWord = New Word.application
    oWord.Visible = True ' set word visible until all developement bugs eliminated. Otherwise you can leave invisible instances of WinWord running
    Set oDoc = oWord.Documents.Open(strDoc)
    Set oDpr = oDoc.BuiltInDocumentProperties(wdPropertyAuthor)
    oDpr.Value = InputBox("Please give a new name for the Author", "Document Property", oDpr.Value)
    oDoc.Save
    oDoc.Close
    oWord.Quit
End Sub
0
 
LVL 1

Expert Comment

by:Kaleb2000ac
ID: 16345354
If you are starting from Word, also you can add word fields in the document so anyone can fill values to document properties directly on word.

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question