Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook: Importing CONTACT ITEMS from HIGHLIGHTED Items only? 1

Status
Not open for further replies.

Docpro777

Programmer
Joined
Jul 1, 2003
Messages
105
Location
US
Is there a way to import SELECTED (Highlighted) CONTACT ITEMS (Task items, Appointment items, or whatever) for IMPORTING to VFP?

I.e., I would HIGHLIGHT Contact items (within or without an Outlook COM window) and hopefully be able to import these highlighted items only.

Even an "I don't know" response would help me, as I've searched hard already and might-should post-pone this hope?

Philip M. Traynor, DPM
 
DocPro777

I don't think VFP can detect a highlighted item, specially if you are using automation, since Outlook itself would only be present as a COM server, and the item in question wouldn't be highlighted. Although in Outlook itself each individual items can be expoted (saved) as an RTF fiel.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi

This again as Mike suggested, I dont think highlighed items alone can be imported into vfp.

However, if all items can be imported, probably. you can use VFP to chosse selected item from a cursor built from all items. :-)

:-)

ramani :-)
(Subramanian.G)
 
Thanks Mike and Ramani,

My conscience is clean then, knowing highlighted contacts, appointments, etc. ALONE, probably can't be selectively imported from VFP.

A work-around, of course, is to import them via COM filter statements (i.e., Outlook ".find", ".restrict", etc.) and also Ramani's method of selecting, presumeably from within 'FOR EACH ITEM ...'-LOOPs (which is my original import method).

As far as selecting items individually in OUTLOOK then exporting them either as vCard files, RTFs, or some other format, I think importing from the COM server directly may perhaps be more do-able.

Philip M. Traynor, DPM
 
DocPro777

Although after a little research, there are unused fields in Outlook that you can add to your contact list to use as a marker to mark a record to be downloaded. For example if you add the field "user1", and use it as a field to mark a record (like putting an "M" in it if you want it marked), and downloading the marked records to a cursor and remarking them, it could be a possibility:
Code:
CREATE CURSOR myCursor (name c(50))
o=Createobject("outlook.application")
ns=o.GetNamespace("mapi")
df=ns.GetDefaultFolder(10)
loItems = df.items
For Each loItem In loItems
	IF loItem.user1 = "M" && detect a marked record
	  INSERT INTO myCursor (name) VALUES (loItem.Email1DisplayName)
           loItem.user1 ="" && Unmarking it.
	endif
Endfor

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike, your idea seems extremely thoughtful and creative, a valid workaround in lieu of highlighting contact items. Some thoughts about marking:

1) To 'mark' an Outlook field (user1 for example) hopefully would not require you to open the item-inspector (a designed form to bring 'user1' to the 1st page). That translates to:
--1 double-click (to open the inspector form)
--An 'm' keystroke (or whatever) to enter in that form
--1-2 form closing keystrokes (SAVE/CLOSE)
THAT would be at least 4 belaboring data entries for the user.

2) "Flagging" on phone view: 2 not so belaboring clicks. Then possibly (?) marking records using the 'flagStatus' property in the item-loops.

3) Using a check-mark field like 'PRIVATE' in Phone-list view (Card view or whatever). (requires the field to be customized by the user, but ...)
ONLY ONE KEYSTROKE. This then would seem a very equivacle work-aound indeed.

4) Possibly better yet: A 'yes/no' check-box Marker field (requires the field to be customized into the phone-list by the user intitially).

Thus your work-around will definitely be worth toying with, esp if I can program these into appearing in the phone-list, etc.

Philip M. Traynor, DPM
 
DocPro777

2) "Flagging" on phone view: 2 not so belaboring clicks. Then possibly (?) marking records using the 'flagStatus' property in the item-loops.

VFP cannot seems to be able to detect that property.

3) Using a check-mark field like 'PRIVATE' in Phone-list view (Card view or whatever). (requires the field to be customized by the user, but ...)
ONLY ONE KEYSTROKE. This then would seem a very equivacle work-aound indeed.


Probably would the best, but again, I could not get VFP to "see" it.

4) Possibly better yet: A 'yes/no' check-box Marker field (requires the field to be customized into the phone-list by the user intitially).

Most likely the route to go.



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
VFP (I believe) can't 'see' Outlook's user-defined/adhoc explorer fields while looping through items/inspectors.

Whatever adhoc explorer field becomes used on the explorer level must also be written into the inspector forms (either by the user or the programmer.)

Methinks the programmer may code it or write it into the inspector form (designed Outlook form).

I'll try to let you know if it works today.

Thanks,

Philip M. Traynor, DPM
 
Alas, I did succeed with the marker field as you suggested.

For VFP to be able to 'see' the 'ad-hoc', user-defined, FOLDER, 'icon'(checkbox)-type field, and not generate 'object-name-not-found' errors, I used this statement logic:

For Each oItem In oItems
If TYPE('oItem.UserProperties.Find(&quot;MyMarker&quot;)')='O' AND oItem.UserProperties.Find(&quot;MyMarker&quot;).Value=.T. &&oItem.Subject<>&quot;Beaty&quot;&& &&&quot;Beaty&quot;
ELSE
Loop
Endif
lLastname=oItem.lastname
lFirstname=oItem.firstname
...etc.

Thanks again, Mike, for your awesome thought in this matter.

Philip M. Traynor, DPM
 
DocPro777

Glad I could help. Thanks for the star.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top