Re: Problem getting Outlook custom form to print to Word

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Sue, All is working fine and it was mainly that it was looking for the oft
file not the dot template that was causing the issue.

However I have now noticed that 3 checkboxes on the Outlook form are not
filling in their equivalent Word tickboxes. I had a look at some other posts
about checkboxes and I am not sure what is causing the fault.

The field is called something like Fee Acknowledged and is a Yes/No Field.
When I rightclick on the control on the form, in the Value tab, it says it is
looking for the field Fee Acknowledge, is a Yes/No field and will display the
Icon. Is there anything else I need to change to get it to work?

Also I used the suggestion of oDoc.FormField("Check1") = user.itemproperties
code (sorry I cant remember the actual code that was used, but it was
different to what I used) and an Error about Value Mismatch came up. Now I
dont understand why that would occur as it has been told to look for a Word
form field called Check1, that is a tickbox, and on the Outlook form it is a
Yes/No field.


My last problem (and a new one I have never seen before), I can create the
form, have it print out (minus the tickboxes being selected) and send it to
someone all fine. But in Outlook Inbox, in the preview pane it says it needs
to be opened to view the contents (which I understand and am ok with). BUT
when I double click to open the email, an error message occurs, stating that
a value parameter is not valid and it will not open the email.
I have never seen this problem before and wonder if you know what might be
causing it? It has only come up so far when I tested the form by using the
Run this Form command under Form menu, while in the Design mode of the
Outlook form.

Again thank you for taking the time to read this and offer suggestion.
Duane

"Duane Nutley" wrote:

Sue,
Thank you for your reply! I cant believe I told it to look at the oft, not
the dot file.

As to the User defined fields, the fields it is looking for are the ones
that are named by right clicking on each field on the form and going to
Properties and putting in a name there. But I will look at what they are
named in the User Defined Fields section of the form.

"Sue Mosher [MVP-Outlook]" wrote:

The symptoms suggest that there is no custom field on the Outlook form named RefNo. Check the names of the fields in the form -- on the All Fields page, under User-defined Fields in This Item.

Also note that this statement could be a problem:

Set oDoc = oWordApp.Documents.Add ("C:\Outlook Templates\Permanent
Placement Details Form.oft")

An .oft file is an Outlook template, not a Word template. A Word template would be saved as an .dot file. And you shouldn't have a space after Documents.Add. Your statements that use the CreateObject and FormFields also have extraneous spaces.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Duane Nutley" <DuaneNutley@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:28F4E0FE-35D3-43E7-8DA8-7E367448A7E9@xxxxxxxxxxxxxxxx
I hope someone can help with the problem I am having as it is frustrating me
quite a bit.

I have been asked to create some Outlook form templates for a company and
that is easy. The hard bit is that they want it to print the way it looks in
the form. After browsing this forum I found the Office Article 290775 (link -
http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3bQ290775&ID=kb%3ben-us%3bQ290775 ) which was quite handy and worked for one form.

I copied/pasted the code from the one form template that worked into a new
one, changed the fields, etc and when I go to print the form I get the
following error message - Object variable not set 'strVacancyRef', which is
the first field on the form.

My VBA skills are limited as I have not worked a lot in VBA, I can fumble my
way through it, but do not understand what I have done wrong as I cant see
any difference between the code that is written, and the example provided in
the article.

I have copied the code below if that helps.

Sub cmdPrint_Click()

Set oWordApp = CreateObject ("Word.Application")
If oWordApp Is Nothing Then
MsgBox "Couldn't start Word"
Else
Dim oWordApp
Dim oWordDoc
Dim bolPrintBackground

'Open a new document.
Set oDoc = oWordApp.Documents.Add ("C:\Outlook Templates\Permanent
Placement Details Form.oft")

'Set the first bookmark
strVacancyRef = Item.UserProperties.Find("RefNo")
oDoc.FormFields ("Text1").Result = strVacancyRef



.



Relevant Pages

  • Re: Global Address List Formatting
    ... You will need to have your clients do a full download to get the template ... Outlook Form or Exchange Form? ... can it be changed so that the Company Field comes directly after ...
    (microsoft.public.exchange.admin)
  • Forcing "From" field value in oft template document
    ... I am currently creating a simple template for use by some folks who will be ... using the same Email account, and therefore already have priviledges to use ... Because we will be constantly using this outlook form, ... the oft template document won't save with the "From" field ...
    (microsoft.public.outlook.program_vba)
  • RE: Forcing "From" field value in oft template document
    ... I have just posted to an old answered post entitled - Opening a Template just ... using the same Email account, and therefore already have priviledges to use ... Because we will be constantly using this outlook form, ... the oft template document won't save with the "From" field ...
    (microsoft.public.outlook.program_vba)
  • unprotect then protect document...
    ... I have a template which is being auto populated with data from an ... outlook form. ... Everything pretty much works like a charm; ... order to allow it to populate then protect it once again. ...
    (microsoft.public.word.vba.beginners)