![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I have created a custom form, but would like to set a command button to open
a Word file located in a network folder. The path to the Word file is G:\Information System\Electronic Communications Policy. I know I need to start with Sub CommandButton1_Click(), but then do not know what else to enter. Can anyone help? Thanks. |
Ads |
#2
|
|||
|
|||
![]()
You cannot directly open a file or cause a program to start by using
VBScript. You need to call something that implements this functionality (such as the Win32 API Shell function), either in an Outlook macro or Add-In or a custom DLL. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "taborp" wrote: I have created a custom form, but would like to set a command button to open a Word file located in a network folder. The path to the Word file is G:\Information System\Electronic Communications Policy. I know I need to start with Sub CommandButton1_Click(), but then do not know what else to enter. Can anyone help? Thanks. |
#3
|
|||
|
|||
![]()
Since it's a Word file, you can use Word automation, along these lines:
Sub CommandButton1_Click() strPath = "G:\Information System\Electronic Communications Policy.doc" Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open(strPath) objDoc.Activate End Sub -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "taborp" wrote in message ... I have created a custom form, but would like to set a command button to open a Word file located in a network folder. The path to the Word file is G:\Information System\Electronic Communications Policy. I know I need to start with Sub CommandButton1_Click(), but then do not know what else to enter. Can anyone help? Thanks. |
#4
|
|||
|
|||
![]()
Sue - you are AWESOME! This works perfect! Thanks so much!
Penny "Sue Mosher [MVP-Outlook]" wrote: Since it's a Word file, you can use Word automation, along these lines: Sub CommandButton1_Click() strPath = "G:\Information System\Electronic Communications Policy.doc" Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open(strPath) objDoc.Activate End Sub -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "taborp" wrote in message ... I have created a custom form, but would like to set a command button to open a Word file located in a network folder. The path to the Word file is G:\Information System\Electronic Communications Policy. I know I need to start with Sub CommandButton1_Click(), but then do not know what else to enter. Can anyone help? Thanks. |
#5
|
|||
|
|||
![]()
Hey Sue:
this code worked great as long as I was in design view, using the run code option. When I actually email the form to myself, the command buttosn do not work when I open the form message. Any ideas? "Sue Mosher [MVP-Outlook]" wrote: Since it's a Word file, you can use Word automation, along these lines: Sub CommandButton1_Click() strPath = "G:\Information System\Electronic Communications Policy.doc" Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open(strPath) objDoc.Activate End Sub -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "taborp" wrote in message ... I have created a custom form, but would like to set a command button to open a Word file located in a network folder. The path to the Word file is G:\Information System\Electronic Communications Policy. I know I need to start with Sub CommandButton1_Click(), but then do not know what else to enter. Can anyone help? Thanks. |
#6
|
|||
|
|||
![]()
Never mind...it was that pesky "send definition with form" item - it was
checked, and I needed to uncheck it. Thanks. Penny "Sue Mosher [MVP-Outlook]" wrote: Since it's a Word file, you can use Word automation, along these lines: Sub CommandButton1_Click() strPath = "G:\Information System\Electronic Communications Policy.doc" Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open(strPath) objDoc.Activate End Sub -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "taborp" wrote in message ... I have created a custom form, but would like to set a command button to open a Word file located in a network folder. The path to the Word file is G:\Information System\Electronic Communications Policy. I know I need to start with Sub CommandButton1_Click(), but then do not know what else to enter. Can anyone help? Thanks. |
#7
|
|||
|
|||
![]()
Sue,
Is it possible to program a command button to launch a Word document with fillable data fields in the document and, once the user has completed filling in the fields, they close the document and the document is saved in the Contact Notes field? For example, an employee at a remote site navigates to our functional mailbox and to the Incident Report folder. Clicks on NEW POST. In the folder, we would create a custom POST form in which the employee fills standard reporting data, then clicks a button launching a Word document in which they complete their detailed report. Conversely, I'd like to program a button to launch a Word document and populate fields in the document with data the user enters into the Contact page. In this example, an employee navigates to our Public Folder in which there is a Contact folder containing employee data. The user goes to a custom page in which the employee enters R&R request data. I need a button on page 2 that would send the request data, (dates, specific airline carriers, frequent flyer numbers, destination, etc), to the individuals supervisor. The supervisor, in turn, will have a button to APPROVE the request. When the APPROVAL even is activated, the supervisor's signature file will be applied to the document. The employee can then click a button on their end which would print a pre-designed document with fields populated from the form along with the signature of the supervisor. That's a lot. I'm buying the book... but I'd like some guidance. Thanks! C "Sue Mosher [MVP-Outlook]" wrote: Since it's a Word file, you can use Word automation, along these lines: Sub CommandButton1_Click() strPath = "G:\Information System\Electronic Communications Policy.doc" Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open(strPath) objDoc.Activate End Sub -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "taborp" wrote in message ... I have created a custom form, but would like to set a command button to open a Word file located in a network folder. The path to the Word file is G:\Information System\Electronic Communications Policy. I know I need to start with Sub CommandButton1_Click(), but then do not know what else to enter. Can anyone help? Thanks. |
#8
|
|||
|
|||
![]()
Creating such a document is a pretty straightforward Word automation project. By "the document is saved in the Contact Notes field," do you mean that you want to attach the document after the user has worked with it? That would be a little more complicated, but not difficult. You'd need to have something in the document -- maybe a custom property holding the EntryID of the original contact -- that would allow the event that fires when the document is closed to find the related Outlook item and attach the document. You'd need either an add-in or a network location to store the Word .dot template files.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Will" wrote in message ... Sue, Is it possible to program a command button to launch a Word document with fillable data fields in the document and, once the user has completed filling in the fields, they close the document and the document is saved in the Contact Notes field? For example, an employee at a remote site navigates to our functional mailbox and to the Incident Report folder. Clicks on NEW POST. In the folder, we would create a custom POST form in which the employee fills standard reporting data, then clicks a button launching a Word document in which they complete their detailed report. Conversely, I'd like to program a button to launch a Word document and populate fields in the document with data the user enters into the Contact page. In this example, an employee navigates to our Public Folder in which there is a Contact folder containing employee data. The user goes to a custom page in which the employee enters R&R request data. I need a button on page 2 that would send the request data, (dates, specific airline carriers, frequent flyer numbers, destination, etc), to the individuals supervisor. The supervisor, in turn, will have a button to APPROVE the request. When the APPROVAL even is activated, the supervisor's signature file will be applied to the document. The employee can then click a button on their end which would print a pre-designed document with fields populated from the form along with the signature of the supervisor. That's a lot. I'm buying the book... but I'd like some guidance. Thanks! C "Sue Mosher [MVP-Outlook]" wrote: Since it's a Word file, you can use Word automation, along these lines: Sub CommandButton1_Click() strPath = "G:\Information System\Electronic Communications Policy.doc" Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open(strPath) objDoc.Activate End Sub -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "taborp" wrote in message ... I have created a custom form, but would like to set a command button to open a Word file located in a network folder. The path to the Word file is G:\Information System\Electronic Communications Policy. I know I need to start with Sub CommandButton1_Click(), but then do not know what else to enter. Can anyone help? Thanks. |
#9
|
|||
|
|||
![]()
It is?? Ok.. so what..I would create the Word doc and include Mail Merge
fields or what? Yes.. I want the user to enter the information into the Word doc and then have the doc saved back into the Outlook item. So, for example, a user opens a leave request form and the form along with the data entered into the form are saved in the users contact Notes filed. Even more- I'd like the data entered into the form to populate custom fields in the custom Contact form as well. I have a place to hold the templates on the server, or I can send the template out to the individuals either way.. I know nothing about add-in's. This is going to either get really complicated or expensive. I either have to learn this on my own or dump the project. There's no funding available to sub-contract this out to a programmer. Is this type of process something one can learn from your book? I ordered it today. Thanks for your guidance. C PS: I'm willing to send you the contact page I've built if you're willing to look at, however, w/out being here, there's not much to learn from looking at the page itself. PSS: Also, on another note, I am having difficulty assigning a button to Phone 5 Selector. On the original template there are 4 command buttons each called Phone#Selector, #=1-4 respectively. I first attempted to copy the button and reassign the Value, binding it to Phone 5 Selector, however, the only options available in the All Contacts Fields are Categories, Check Address, Check Name, Contacts, Edit Yomi and Flag Color. The fields that are normally there are simply not. I assume this has to do w/the fact that I'm looking to bind the command button and not a text field, however, I'm not sure. Anywhoo, second, I attempted to create my own command button instead of copying it. I only copied it b/c I wanted to maintain the black downward pointing triangle picture that is on the standard four buttons on the new buttons I created. Guess I'll have to go through the trouble of finding the picture and applying it to the new command button.. regardless, however, the same issue is there. I am unable to bind the button Value to the Phone 5 Selector Field. I had no issues w/binding the text box I created, however to display the Phone 5 Selected field. Ugh! Thanks! C "Sue Mosher [MVP-Outlook]" wrote: Creating such a document is a pretty straightforward Word automation project. By "the document is saved in the Contact Notes field," do you mean that you want to attach the document after the user has worked with it? That would be a little more complicated, but not difficult. You'd need to have something in the document -- maybe a custom property holding the EntryID of the original contact -- that would allow the event that fires when the document is closed to find the related Outlook item and attach the document. You'd need either an add-in or a network location to store the Word .dot template files. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Will" wrote in message ... Sue, Is it possible to program a command button to launch a Word document with fillable data fields in the document and, once the user has completed filling in the fields, they close the document and the document is saved in the Contact Notes field? For example, an employee at a remote site navigates to our functional mailbox and to the Incident Report folder. Clicks on NEW POST. In the folder, we would create a custom POST form in which the employee fills standard reporting data, then clicks a button launching a Word document in which they complete their detailed report. Conversely, I'd like to program a button to launch a Word document and populate fields in the document with data the user enters into the Contact page. In this example, an employee navigates to our Public Folder in which there is a Contact folder containing employee data. The user goes to a custom page in which the employee enters R&R request data. I need a button on page 2 that would send the request data, (dates, specific airline carriers, frequent flyer numbers, destination, etc), to the individuals supervisor. The supervisor, in turn, will have a button to APPROVE the request. When the APPROVAL even is activated, the supervisor's signature file will be applied to the document. The employee can then click a button on their end which would print a pre-designed document with fields populated from the form along with the signature of the supervisor. That's a lot. I'm buying the book... but I'd like some guidance. Thanks! C "Sue Mosher [MVP-Outlook]" wrote: Since it's a Word file, you can use Word automation, along these lines: Sub CommandButton1_Click() strPath = "G:\Information System\Electronic Communications Policy.doc" Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open(strPath) objDoc.Activate End Sub -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "taborp" wrote in message ... I have created a custom form, but would like to set a command button to open a Word file located in a network folder. The path to the Word file is G:\Information System\Electronic Communications Policy. I know I need to start with Sub CommandButton1_Click(), but then do not know what else to enter. Can anyone help? Thanks. |
#10
|
|||
|
|||
![]()
Yes, this is a complicated project -- straightforward, because no "tricks" are involved, but complex because you want to pass data from Outlook to Word, and then back again.
Add-ins are covered in books by Randy Byrne and others. My books concentrate on the basics. I'm still not clear on whether ("have the doc saved back into the Outlook item") means attaching a Word document or filling Outlook contact fields or both. As for Phone Selector 5, you should be able to drag it to the form from the Field Chooser. You might want take a look at the samples at http://www.outlookcode.com/article.aspx?ID=24 that use Word for printing. They use techniques that would be relevant for your project. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Will" wrote in message ... It is?? Ok.. so what..I would create the Word doc and include Mail Merge fields or what? Yes.. I want the user to enter the information into the Word doc and then have the doc saved back into the Outlook item. So, for example, a user opens a leave request form and the form along with the data entered into the form are saved in the users contact Notes filed. Even more- I'd like the data entered into the form to populate custom fields in the custom Contact form as well. I have a place to hold the templates on the server, or I can send the template out to the individuals either way.. I know nothing about add-in's. This is going to either get really complicated or expensive. I either have to learn this on my own or dump the project. There's no funding available to sub-contract this out to a programmer. Is this type of process something one can learn from your book? I ordered it today. PSS: Also, on another note, I am having difficulty assigning a button to Phone 5 Selector. Thanks! C "Sue Mosher [MVP-Outlook]" wrote: Creating such a document is a pretty straightforward Word automation project. By "the document is saved in the Contact Notes field," do you mean that you want to attach the document after the user has worked with it? That would be a little more complicated, but not difficult. You'd need to have something in the document -- maybe a custom property holding the EntryID of the original contact -- that would allow the event that fires when the document is closed to find the related Outlook item and attach the document. You'd need either an add-in or a network location to store the Word .dot template files. "Will" wrote in message ... Sue, Is it possible to program a command button to launch a Word document with fillable data fields in the document and, once the user has completed filling in the fields, they close the document and the document is saved in the Contact Notes field? For example, an employee at a remote site navigates to our functional mailbox and to the Incident Report folder. Clicks on NEW POST. In the folder, we would create a custom POST form in which the employee fills standard reporting data, then clicks a button launching a Word document in which they complete their detailed report. Conversely, I'd like to program a button to launch a Word document and populate fields in the document with data the user enters into the Contact page. In this example, an employee navigates to our Public Folder in which there is a Contact folder containing employee data. The user goes to a custom page in which the employee enters R&R request data. I need a button on page 2 that would send the request data, (dates, specific airline carriers, frequent flyer numbers, destination, etc), to the individuals supervisor. The supervisor, in turn, will have a button to APPROVE the request. When the APPROVAL even is activated, the supervisor's signature file will be applied to the document. The employee can then click a button on their end which would print a pre-designed document with fields populated from the form along with the signature of the supervisor. That's a lot. I'm buying the book... but I'd like some guidance. Thanks! C "Sue Mosher [MVP-Outlook]" wrote: Since it's a Word file, you can use Word automation, along these lines: Sub CommandButton1_Click() strPath = "G:\Information System\Electronic Communications Policy.doc" Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open(strPath) objDoc.Activate End Sub -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "taborp" wrote in message ... I have created a custom form, but would like to set a command button to open a Word file located in a network folder. The path to the Word file is G:\Information System\Electronic Communications Policy. I know I need to start with Sub CommandButton1_Click(), but then do not know what else to enter. Can anyone help? Thanks. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Command Button | Daniel Vargas | Outlook - Using Forms | 1 | May 23rd 07 10:35 PM |
Which Macro is linked to Command Button | expect_ed | Outlook and VBA | 1 | May 22nd 07 08:47 PM |
Sending message via command button | Gil | Outlook and VBA | 3 | May 2nd 07 08:31 PM |
command button and multipage | snwooz | Outlook - Using Forms | 1 | November 1st 06 08:26 PM |
Command Button on Read Page | [email protected] | Outlook - Using Forms | 2 | October 18th 06 09:05 PM |