Outlook data into Excel

D

donwb

I use Win XP and Office 2003
I am using a routine to extract information from Outlook and use it in
Excel.
There are a number of lines of code in the Excel macro to define the various
Outlook elements,
then this:-

<<Set objContact = olJournalFolder.Items.Find("[ContactNames] =
""Singer""")>>
<<myItem = objContact.Display>>

which works fine, but the following gives the error:- Type Mismatch or the
value"MyDate" in the condition is not valid.

Set objDate = olJournalFolder.Items.Find("[Start] = MyDate")

(MyDate is a variable in the Format dd mm yyyy, which is the same format as
the 'Start' dates in the Outlook Journal.)

I think it must be a wrong syntax or date format, as I expected
"ContactNames" and "Start" to be treated the same in the .Find statement.

Guidance would be welcome
donwb
 
D

donwb

Michael, Thanks for the reply which helped.
One further question - Is there a JournalItem property that returns an index
number representing its place in the Journal list?
A JournalItem can be returned by Item(a number) - what will return the index
itself.
donwb


Michael Bauer said:
Please look into the VBA help for Find or Restrict. It has a sample for
how
to use dates in the query.

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:

<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Mon, 10 Mar 2008 20:57:04 -0000 schrieb donwb:
I use Win XP and Office 2003
I am using a routine to extract information from Outlook and use it in
Excel.
There are a number of lines of code in the Excel macro to define the various
Outlook elements,
then this:-

<<Set objContact = olJournalFolder.Items.Find("[ContactNames] =
""Singer""")>>
<<myItem = objContact.Display>>

which works fine, but the following gives the error:- Type Mismatch or the
value"MyDate" in the condition is not valid.

Set objDate = olJournalFolder.Items.Find("[Start] = MyDate")

(MyDate is a variable in the Format dd mm yyyy, which is the same format as
the 'Start' dates in the Outlook Journal.)

I think it must be a wrong syntax or date format, as I expected
"ContactNames" and "Start" to be treated the same in the .Find statement.

Guidance would be welcome
donwb
 
D

donwb

Michael, Thanks for the reply which helped.
One further question - Is there a JournalItem property that returns an index
number representing its place in the Journal list?
A JournalItem can be returned by Item(a number) - what will return the index
itself.
donwb


Michael Bauer said:
Please look into the VBA help for Find or Restrict. It has a sample for
how
to use dates in the query.

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:

<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Mon, 10 Mar 2008 20:57:04 -0000 schrieb donwb:
I use Win XP and Office 2003
I am using a routine to extract information from Outlook and use it in
Excel.
There are a number of lines of code in the Excel macro to define the various
Outlook elements,
then this:-

<<Set objContact = olJournalFolder.Items.Find("[ContactNames] =
""Singer""")>>
<<myItem = objContact.Display>>

which works fine, but the following gives the error:- Type Mismatch or the
value"MyDate" in the condition is not valid.

Set objDate = olJournalFolder.Items.Find("[Start] = MyDate")

(MyDate is a variable in the Format dd mm yyyy, which is the same format as
the 'Start' dates in the Outlook Journal.)

I think it must be a wrong syntax or date format, as I expected
"ContactNames" and "Start" to be treated the same in the .Find statement.

Guidance would be welcome
donwb
 
D

donwb

Michael, Thanks for the reply which helped.
One further question - Is there a JournalItem property that returns an index
number representing its place in the Journal list?
A JournalItem can be returned by Item(a number) - what will return the index
itself.
donwb


Michael Bauer said:
Please look into the VBA help for Find or Restrict. It has a sample for
how
to use dates in the query.

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:

<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Mon, 10 Mar 2008 20:57:04 -0000 schrieb donwb:
I use Win XP and Office 2003
I am using a routine to extract information from Outlook and use it in
Excel.
There are a number of lines of code in the Excel macro to define the various
Outlook elements,
then this:-

<<Set objContact = olJournalFolder.Items.Find("[ContactNames] =
""Singer""")>>
<<myItem = objContact.Display>>

which works fine, but the following gives the error:- Type Mismatch or the
value"MyDate" in the condition is not valid.

Set objDate = olJournalFolder.Items.Find("[Start] = MyDate")

(MyDate is a variable in the Format dd mm yyyy, which is the same format as
the 'Start' dates in the Outlook Journal.)

I think it must be a wrong syntax or date format, as I expected
"ContactNames" and "Start" to be treated the same in the .Find statement.

Guidance would be welcome
donwb
 
M

Michael Bauer [MVP - Outlook]

No. What would you need that for?

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Tue, 11 Mar 2008 19:23:41 -0000 schrieb donwb:
Michael, Thanks for the reply which helped.
One further question - Is there a JournalItem property that returns an index
number representing its place in the Journal list?
A JournalItem can be returned by Item(a number) - what will return the index
itself.
donwb


Michael Bauer said:
Please look into the VBA help for Find or Restrict. It has a sample for
how
to use dates in the query.
Am Mon, 10 Mar 2008 20:57:04 -0000 schrieb donwb:
I use Win XP and Office 2003
I am using a routine to extract information from Outlook and use it in
Excel.
There are a number of lines of code in the Excel macro to define the various
Outlook elements,
then this:-

<<Set objContact = olJournalFolder.Items.Find("[ContactNames] =
""Singer""")>>
<<myItem = objContact.Display>>

which works fine, but the following gives the error:- Type Mismatch or the
value"MyDate" in the condition is not valid.

Set objDate = olJournalFolder.Items.Find("[Start] = MyDate")

(MyDate is a variable in the Format dd mm yyyy, which is the same format as
the 'Start' dates in the Outlook Journal.)

I think it must be a wrong syntax or date format, as I expected
"ContactNames" and "Start" to be treated the same in the .Find statement.

Guidance would be welcome
donwb
 
D

donwb

Hi Michael

My Excel program records specific Outlook Journal Items (5), in diary like
fashion, for all Outlook Journal entries.

These are displayed in the Excel program in a UserForm ListBox.

When a new Outlook Journal entry is made, it is recorded automatically in
the Excel program.

I require the facility to click an entry in the Excel ListBox and use this
to display the entry's Outlook Journal dialog box. (The one you normally get
by double clicking the entry in Outlook Journal).

If it were possible to record each Entry's Index Number (position in the
Journal) when the entry is recorded in Excel, then this could be used later
to recall the entry's dialog box from outlook.

Otherwise, the only way I can do it, when the entry is saved to Excel, it is
to iterate each entry with a counter until the desired one is found, then
record the counter as the entry's index.

donwb


Michael Bauer said:
No. What would you need that for?

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:

<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Tue, 11 Mar 2008 19:23:41 -0000 schrieb donwb:
Michael, Thanks for the reply which helped.
One further question - Is there a JournalItem property that returns an index
number representing its place in the Journal list?
A JournalItem can be returned by Item(a number) - what will return the index
itself.
donwb


Michael Bauer said:
Please look into the VBA help for Find or Restrict. It has a sample for
how
to use dates in the query.
Am Mon, 10 Mar 2008 20:57:04 -0000 schrieb donwb:

I use Win XP and Office 2003
I am using a routine to extract information from Outlook and use it in
Excel.
There are a number of lines of code in the Excel macro to define the
various
Outlook elements,
then this:-

<<Set objContact = olJournalFolder.Items.Find("[ContactNames] =
""Singer""")>>
<<myItem = objContact.Display>>

which works fine, but the following gives the error:- Type Mismatch or
the
value"MyDate" in the condition is not valid.

Set objDate = olJournalFolder.Items.Find("[Start] = MyDate")

(MyDate is a variable in the Format dd mm yyyy, which is the same
format
as
the 'Start' dates in the Outlook Journal.)

I think it must be a wrong syntax or date format, as I expected
"ContactNames" and "Start" to be treated the same in the .Find statement.

Guidance would be welcome
donwb
 
M

Michael Bauer [MVP - Outlook]

You can use the item's EntryID for that. To make it perfect, you can
additionally store the folder's StoreID (Item.Parent.StoreID).

With that you can call the GetItemFromID function to retrieve the item.

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Wed, 12 Mar 2008 10:14:37 -0000 schrieb donwb:
Hi Michael

My Excel program records specific Outlook Journal Items (5), in diary like
fashion, for all Outlook Journal entries.

These are displayed in the Excel program in a UserForm ListBox.

When a new Outlook Journal entry is made, it is recorded automatically in
the Excel program.

I require the facility to click an entry in the Excel ListBox and use this
to display the entry's Outlook Journal dialog box. (The one you normally get
by double clicking the entry in Outlook Journal).

If it were possible to record each Entry's Index Number (position in the
Journal) when the entry is recorded in Excel, then this could be used later
to recall the entry's dialog box from outlook.

Otherwise, the only way I can do it, when the entry is saved to Excel, it is
to iterate each entry with a counter until the desired one is found, then
record the counter as the entry's index.

donwb


Michael Bauer said:
No. What would you need that for?
Am Tue, 11 Mar 2008 19:23:41 -0000 schrieb donwb:
Michael, Thanks for the reply which helped.
One further question - Is there a JournalItem property that returns an index
number representing its place in the Journal list?
A JournalItem can be returned by Item(a number) - what will return the index
itself.
donwb




Please look into the VBA help for Find or Restrict. It has a sample for
how
to use dates in the query.
Am Mon, 10 Mar 2008 20:57:04 -0000 schrieb donwb:

I use Win XP and Office 2003
I am using a routine to extract information from Outlook and use it in
Excel.
There are a number of lines of code in the Excel macro to define the
various
Outlook elements,
then this:-

<<Set objContact = olJournalFolder.Items.Find("[ContactNames] =
""Singer""")>>
<<myItem = objContact.Display>>

which works fine, but the following gives the error:- Type Mismatch or
the
value"MyDate" in the condition is not valid.

Set objDate = olJournalFolder.Items.Find("[Start] = MyDate")

(MyDate is a variable in the Format dd mm yyyy, which is the same
format
as
the 'Start' dates in the Outlook Journal.)

I think it must be a wrong syntax or date format, as I expected
"ContactNames" and "Start" to be treated the same in the .Find statement.

Guidance would be welcome
donwb
 
D

donwb

Many thanks Michael.
I hadn't picked up on the folder's StoreID.
I'll give it a try, but it sounds like it'll take a while.
donwb

Michael Bauer said:
You can use the item's EntryID for that. To make it perfect, you can
additionally store the folder's StoreID (Item.Parent.StoreID).

With that you can call the GetItemFromID function to retrieve the item.

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:

<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Wed, 12 Mar 2008 10:14:37 -0000 schrieb donwb:
Hi Michael

My Excel program records specific Outlook Journal Items (5), in diary
like
fashion, for all Outlook Journal entries.

These are displayed in the Excel program in a UserForm ListBox.

When a new Outlook Journal entry is made, it is recorded automatically in
the Excel program.

I require the facility to click an entry in the Excel ListBox and use
this
to display the entry's Outlook Journal dialog box. (The one you normally get
by double clicking the entry in Outlook Journal).

If it were possible to record each Entry's Index Number (position in the
Journal) when the entry is recorded in Excel, then this could be used later
to recall the entry's dialog box from outlook.

Otherwise, the only way I can do it, when the entry is saved to Excel, it is
to iterate each entry with a counter until the desired one is found, then
record the counter as the entry's index.

donwb


Michael Bauer said:
No. What would you need that for?
Am Tue, 11 Mar 2008 19:23:41 -0000 schrieb donwb:

Michael, Thanks for the reply which helped.
One further question - Is there a JournalItem property that returns an
index
number representing its place in the Journal list?
A JournalItem can be returned by Item(a number) - what will return the
index
itself.
donwb




Please look into the VBA help for Find or Restrict. It has a sample
for
how
to use dates in the query.
Am Mon, 10 Mar 2008 20:57:04 -0000 schrieb donwb:

I use Win XP and Office 2003
I am using a routine to extract information from Outlook and use it
in
Excel.
There are a number of lines of code in the Excel macro to define the
various
Outlook elements,
then this:-

<<Set objContact = olJournalFolder.Items.Find("[ContactNames] =
""Singer""")>>
<<myItem = objContact.Display>>

which works fine, but the following gives the error:- Type Mismatch or
the
value"MyDate" in the condition is not valid.

Set objDate = olJournalFolder.Items.Find("[Start] = MyDate")

(MyDate is a variable in the Format dd mm yyyy, which is the same
format
as
the 'Start' dates in the Outlook Journal.)

I think it must be a wrong syntax or date format, as I expected
"ContactNames" and "Start" to be treated the same in the .Find
statement.

Guidance would be welcome
donwb
 

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